DESK-MX6-L/pdf

From DAVE Developer's Wiki
Jump to: navigation, search


History[edit | edit source]

History
Version Issue Date Notes Refers to

1.0.0

Jun 2021 First DESK release AXEL Lite SOM
SBC Axel SBC

3.0.1

Sep 2022 Update to NXP 5.10.35 AXEL Lite SOM
SBC Axel SBC

4.0.0

Apr 2023 Update to NXP 5.15.71 AXEL Lite SOM
SBC Axel SBC
4.0.1 Jun 2023 Minor update AXEL Lite-SOM-top.pngAXEL Lite SOM
AXEL Lite-EVK-kit-SBC.pngSBC Axel SBC


General Information[edit | edit source]

Release Notes[edit | edit source]

DAVE Embedded Systems adds to the latest Linux BSP from NXP the customization required to support the SOC platform. For this reason most of the documentation provided by NXP remains valid for the DESK development kit.

However, some customization is required, in particular at bootloader and linux kernel levels.

The following table reports the DESK releases information.

DESK version
Release number 4.0.1
Release type Minor
Status Released
Release date Jun 2023
Release notes Ver 4.0.1
Product support AXEL Lite
MVM (distro version) Ubuntu 20.04
U-Boot version 2022.04-desk-mx6-l-4.0.1
Linux version 5.15.71-desk-mx6-l-4.0.1
Drivers

UART debug (2-wire)
USB Host
USB OTG
SD
CAN
EMAC
HDMI
SPL boot

LVDS
NAND
RTC
I2C
SPI
Video Input (MIPI)
PCIe
ConfigID
Splash screen

Manufacturer BSP version lf-5.15.71-2.2.0
Graphic libraries Qt 6.3.2
Build System Yocto Kirkstone (4.0)
Android

DESK-MX6-L 4.0.1[edit | edit source]

Release notes:

  • Minor change to DESK-MX6-L-4.0.0
  • remove some kernel runtime warnings/error
  • prevent black screen due wrong LCD clock switch issue in U-Boot
  • install additional Qt6 packages
  • add some development packages (libgpiod, phytool, devmem2,...)
  • allow to modify U-Boot environment from userspace (SD boot only)
  • show U-Boot splashscreen earlier

Known Limitations[edit | edit source]

The limitations are the same of DESK-MX6-L-4.0.0

Downloadable binary images[edit | edit source]

All binary images for DESK-MX6-L are hosted on DAVE Embedded System mirror server. There you can find a sub directory for each version of this development kit.

U-Boot performs 2-stage bootloader providing two files: SPL and u-boot.img. Both two files must be stored into SD card using dd command.

A summary of images with a brief description can be found into the table below:

Image DESK-MX6-L version 4.0.1
Platform SBCX - SBCX560012C2R
Carrier Board ConfigID 0012
LCD panel Ampire 800 x 480 7" LVDS 262K colors (RGB666)
Touchscreen resistive
SPL SPL (Quad / NOR) SPL (DualLite / NAND)
u-boot.img (Quad / NOR) (DualLite / NAND)
Linux kernel uImage
Device tree (QUAD) imx6q-sbcx-cb0012.dtb
Device tree (DualLite) imx6dl-sbcx-cb0012.dtb

Yocto images and built-in packages[edit | edit source]

Yocto target images for DESK-MX6-L are hosted on DAVE Embedded System mirror server. There are more build targets which include a list of built and installed packages in the root file system image.

A summary of built images and their included packages can be found in the table below:

Image DESK-MX6-L version 4.0.1
root file system packages list
devel desk-image-devel.bz2 image-devel_installed-packages.txt
qt6 fb desk-image-qt6-fb.bz2 image-qt6-fb_installed-packages.txt
qt6 wayland desk-image-devel.bz2 image-devel_installed-packages.txt
x11 desk-image-x11.bz2 image-x11_installed-packages.txt
x11 browser desk-image-x11-browser.bz2 image-x11-browser_installed-packages.txt

DESK-MX6-L 4.0.0[edit | edit source]

200px-Emblem-important.svg.png

New MVM must be installed for using DESK-MX6-L-4.0.0. The VM is available for download on DAVE's XELK Reserved Area for registered users.

Release notes:

  • Major change to NXP BSP 5.15.71
  • Updated U-Boot and kernel versions
  • Updated Yocto version
  • Updated Qt version

Known Limitations[edit | edit source]

The following table reports the known limitations of this DESK release:

Issue Description
NAND Samsung NAND Model K9F4G08U0D not detected in u-boot
Linux kernel xconfig make xconfig does not work
X11 GPU driver Change GPU Vivante driver for X11 backend support


200px-Emblem-important.svg.png

X11 support is not supported anymore by NXP BSPs. X11 support has been added for legacy compatibility (desk-image-x11-browser image) but will be dropped on future releases

Downloadable binary images[edit | edit source]

All binary images for DESK-MX6-L are hosted on DAVE Embedded System mirror server. There you can find a sub directory for each version of this development kit.

U-Boot performs 2-stage bootloader providing two files: SPL and u-boot.img. Both two files must be stored into SD card using dd command.

A summary of images with a brief description can be found into the table below:

Image DESK version 4.0.0
Platform SBCX - SBCX560012C2R
Carrier Board ConfigID 0012
LCD panel Ampire 800 x 480 7" LVDS 262K colors (RGB666)
Touchscreen resistive
SPL SPL (Quad / NOR) SPL (DualLite / NAND)
u-boot.img (Quad / NOR) (DualLite / NAND)
Linux kernel uImage
Device tree (QUAD) imx6q-sbcx-cb0012.dtb
Device tree (DualLite) imx6dl-sbcx-cb0012.dtb

DESK-MX6-L 3.0.1[edit | edit source]

200px-Emblem-important.svg.png

New MVM must be installed for using DESK-MX6-L-3.0.0. The VM is available for download on DAVE's XELK Reserved Area for registered users.

Release notes:

  • Fix ethernet QUAD SOM support
  • Updated Qt libraries for tslib plugin support

Known Limitations[edit | edit source]

The following table reports the known limitations of this DESK release:

Issue Description
NAND Samsung NAND Model K9F4G08U0D not detected in u-boot
Linux kernel xconfig make xconfig does not work

Downloadable binary images[edit | edit source]

All binary images for DESK-MX6-L are hosted on DAVE Embedded System mirror server. There you can find a sub directory for each version of this development kit.

U-Boot performs 2-stage bootloader providing two files: SPL and u-boot.img. Both two files must be stored into SD card using dd command.

A summary of images with a brief description can be found into the table below:

Image DESK version 3.0.1
Platform SBCX - SBCX560012C2R
Carrier Board ConfigID 0012
LCD panel Ampire 800 x 480 7" LVDS 262K colors (RGB666)
Touchscreen resistive
SPL SPL (Quad / NOR) SPL (DualLite / NAND)
u-boot.img (Quad / NOR) (DualLite / NAND)
Linux kernel uImage
Device tree (QUAD) imx6q-sbcx-cb0012.dtb
Device tree (DualLite) imx6dl-sbcx-cb0012.dtb

DESK-MX6-L 3.0.0[edit | edit source]

200px-Emblem-important.svg.png

New MVM must be installed for using DESK-MX6-L-3.0.0. The VM is available for download on DAVE's XELK Reserved Area for registered users.

Release notes:

  • Major change to NXP BSP 5.10.35
  • Updated U-Boot and kernel versions
  • Updated Yocto version
  • Updated Qt version

Known Limitations[edit | edit source]

The following table reports the known limitations of this DESK release:

Issue Description
NAND Samsung NAND Model K9F4G08U0D not detected in u-boot
Linux kernel xconfig make xconfig does not work
Linux kernel Ethernet does not work on QUAD SOM module
Yocto Qt5 tslib plugin not present

DESK-MX6-L 1.0.2[edit | edit source]

200px-Emblem-important.svg.png

New MVM must be installed for using DESK-MX6-L-1.0.0. The VM is available for download on DAVE's XELK Reserved Area for registered users.

Release notes:

  • Updated U-Boot and kernel versions for cb0067 and cb0077 support
  • cb0077 integrates the usage of DWS WiFi add-on module

Downloadable binary images[edit | edit source]

All binary images for DESK-MX6-L are hosted on DAVE Embedded System mirror server. There you can find a sub directory for each version of this development kit.

U-Boot performs 2-stage bootloader providing two files: SPL and u-boot.img. Both two files must be stored into SD card using dd command.

A summary of images with a brief description can be found into the table below:

Image DESK version 1.0.2
Platform SBCX - SBCX560012C2R
Carrier Board ConfigID 0012
LCD panel Ampire 800 x 480 7" LVDS 262K colors (RGB666)
Touchscreen resistive
SPL SPL (Quad / NOR) SPL (DualLite / NAND)
u-boot.img (Quad / NOR) (DualLite / NAND)
Linux kernel uImage
Device tree (Quad) imx6q-sbcx-cb0012.dtb
Device tree (DualLite) imx6dl-sbcx-cb0012.dtb

DESK-MX6-L 1.0.0[edit | edit source]

200px-Emblem-important.svg.png

New MVM must be installed for using DESK-MX6-L-1.0.0. The VM is available for download on DAVE's XELK Reserved Area for registered users.

Release notes:

  • Major change to NXP BSP 4.14.98
  • Updated U-Boot and kernel versions
  • Updated Yocto version
  • Updated Qt version

Known Limitations[edit | edit source]

The following table reports the known limitations of this DESK release:

Issue Description
NAND Samsung NAND Model K9F4G08U0D not detected in u-boot
Linux kernel xconfig make xconfig does not work

Release types[edit | edit source]

DESK release type can be:

  • Major, when substantial changes are applied to the BSP (eg: major kernel version upgrades) or to the development kit (eg: new features, build system updates, ..). This usually means that a new DVDK is created for the DESK release
  • Maintenance, when minor updates and bug fixes are introduced. This usually means that the DVDK remains the same provided with the previous major version, and only an update of the source tree repositories (and the tftp binaries) is required

As an example, DESK 1.1.0 is a maintenance release, so it provides the DVDK released with the 1.0.0 major release; customers can easily upgrade to the 1.1.0 release by updating the software components as described in Synchronizing git repositories.

Supported platforms[edit | edit source]

The following table reports the supported platforms in this DESK release:

Platform Description
SBC AXEL Single Board Computer using AXEL Lite SOM as Evaluation Kit


Virtual Machine[edit | edit source]

DESK-MX6-L contains all the required software and documentation to start developing Linux application on the Axel platform. In particular, DESK-MX6-L provides a virtual machine, called DVDK, with the following features:

  • VirtualBox virtual machine (.OVA archive)
  • based on Lubuntu 20.04 LTS (64-bit version)
  • pre-installed VirtualBox Guest Additions
  • LXDE desktop environment
  • boot disk with the distro and pre-configured basic Linux services:
    • TFTP: with base directory /srv/tftp/
    • NFS: configured through the /etc/exports file
  • secondary disk containing source code and tools:
    • bootloader (u-boot) source tree cloned from DAVE Embedded Systems public git repository
    • Linux kernel source tree cloned from DAVE Embedded Systems public git repository
    • external pre-built toolchain
    • Yocto BSP for AXEL Lite SOM
  • pre-installed Yocto-based root file systems with setup scripts, makefiles, example applications, ...
  • administrator account (dvdk) with autologin. Please note that the user account credentials are provided with the development kit (you can find them in the README file contained in the sw/dvdk folder of the kit distribution)
    • user: dvdk
    • password: dvdk

Please note that u-boot and kernel source trees are derived from the official trees released by NXP/Freescale; these trees have been customized to add support for the AXEL Lite SOM.

Host setup[edit | edit source]

As stated previously, AXEL Lite SOM host tools are based on a Managed Virtual Machine. MVM OVA files can be downloaded here. For accessing DESK Reserved area please contact our helpdesk support channel

To install it, please refer to this page.

It is worth remembering that access to git repositories is required to download target source code. To enable it, please refer to this page.

Virtual Machine updates[edit | edit source]

The Ubuntu distribution may ask for an update, if available, due to the Update Notifier.

Update Ubuntu Notifier.png

The updates are not required for the proper DESK Virtual Machine functionality.


200px-Emblem-important.svg.png

Even if the update can be transparent to the VM normal operations, it is suggested to not install the updates. They may change (or in a worst-case corrupt) what has been tested and documented in our wiki pages

If this is annoying for you, it is possible to disable it.


ConfigID and UniqueID[edit | edit source]

ConfigID[edit | edit source]

ConfigID is a new feature of DAVE Embedded Systems products. Its main purpose is providing an automatic mechanism for the identification of the product model and configuration.

With ConfigID, we aim at:

  • completing the hardware configuration information that the software can't normally auto-detect (i.e. RAM chip version,...), implementing a dedicated reliable detect procedure
  • when required, overriding the auto-detected hardware configuration information

When implemented, this mechanism allows for:

  • initializing in the proper way the hardware platform, based on the specific features and parameters of the product, using a common software base (eg: a typical case is the SDRAM controller parameters, which must be configured by U-Boot depending on the particular memory chip, which can be different for the various SOM models)
  • getting the complete hardware configuration (combining ConfigID with the information collectable at runtime) of a product deployed on the field

In simple words, model identification means the capability of reading a numerical code, stored in an available device (SOC's OTP , I2C EEPROM, 1-wire memories, protected NOR flash, etc.)

There are two ConfigIDs:

  • SOM ConfigID: which reflects the characteristics of the SOM (stored on the SOM itself)
  • Carrier Board (CB) ConfigID: which reflects the characteristics of the carrier board that hosts the SOM (stored on the carrier board itself and read by the SOM at boot time)

UniqueID[edit | edit source]

An additional attribute is UniqueID, which is a read-only code which univocally identifies a single product and is used for traceability.


200px-Emblem-important.svg.png

It is worth remembering that ConfigID and UniqueID are independent from product serial number.

Customer's action[edit | edit source]

DAVE Embedded Systems recommends to be up-to-date with Official SOM's BSPs for taking advantages of ConfigID/UniqueId features: this is the only required action.

  • ConfigID advantage: to allow U-Boot bootloader to be executed only with the correct configuration (if the U-Boot loaded is not the proper one, it may stop execution avoiding incorrect behaviour)
  • UniqueID advantage: to trace univocally each individual SOMs and, in turn, all the on-the-field equipments

ConfigID values[edit | edit source]

ConfigID is a N-bit (typically N>8) signed integer, that can have the following values:

  • < 0: error
    • -1: not initialized
  • = 0: ConfigID legacy
    • for prototypes (ConfigID not yet defined) or for products manufactured before the introduction of the ConfigID feature
  • > 0: valid ConfigID
    • values are reported accordingly with the specific product table

Hardware implementations of the ConfigID[edit | edit source]

The following paragraphs briefly describe the available solutions for storing the ConfigID.

OTP on the SOC[edit | edit source]

Some SOCs provides programmable OTPs (eg. for security, MAC address, boot modes, etc). Usually, some of these are general purpose registers and can be managed by the user.

This is the ideal implementation, because:

  • ConfigID is stored in the most important component of the SOM
  • the component that hosts the ConfigID is NOT optional
  • typically, a very selective lock can be forced. In general, for reliability and/or security reasons, OTP areas used to store ConfigIDs may be locked during the manufacturing process.

OTP 1-wire memory[edit | edit source]

This implementation requires a 1-wire memory chip.

I2C Eeprom[edit | edit source]

This implementation requires connecting an EEPROM to an I2C bus of the SOC. Moreover, routing a write protect pin to the SOM connector is required.

NOR Flash SPI[edit | edit source]

This implementation requires a NOR flash connected to the SPI bus of the SOC.

DAVE Embedded Systems' hardware implementation[edit | edit source]

DAVE's SOCs implement the ConfigID feature depending on hardware Capabilities of the SOCs. The following list shows the priority used for its implementation:

  1. OTPs
    1. example: AXEL family processor (i.MX6) implements ConfigID using processor's OTP
    2. AXEL uses GP1 eFuse register to store ConfigID
  2. NOR Flash SPI
    1. example: DIVA family processor (AM335x) implements ConfigID using NOR SPI (if present)
    2. DIVA and BORA use the first 32bytes OTP block on NOR SPI to store ConfigID (and its CRC32), UniqueID (and its CRC32)
  3. I2C Eeprom
    1. example: DIVA family processor (AM335x) or BORA Lite processor (ZYNQ) implements ConfigID using I2C Eeprom when NOR SPI is not present (module boots from NAND or SD)
    2. DIVA and BORA Lite use the first 32bytes on I2C EPROM to store ConfigID (and its CRC32), UniqueID (and its CRC32)
  4. 1-wire
    1. example: latest AXEL Lite, AXEL ULite and BORA/BORA Xpress/BORA Lite Evaluation Kits implement CB ConfigID using the onboard 1-wire device (DS2431)

Software implementation[edit | edit source]

U-Boot[edit | edit source]

u-boot integrates the software routines for reading and displaying the ConfigID: hereunder an example of SOM ConfigID at startup:

U-Boot 2013.04-00010-gcb05b30 (Jun 26 2015 - 12:49:26)-xelk-2.1.0

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz
CPU:   Temperature 47 C, limits (-40 C, 125 C), calibration data: 0xc0
Reset cause: POR
Environment: SPI Flash
I2C:   ready
DRAM:  2 GiB
Now running in RAM - U-Boot at: 8ff35000
NAND:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
In:    serial
Out:   serial
Err:   serial
Power: found PFUZE100 (devid=10, revid=21)
SOM ConfigID#: 00000003
SOM UniqueID#: df646299:0b0579d4

For accessing these information on Linux procfs, the device tree must be modified (using u-boot fdt command): for example:

DIVA# setenv fdtfixup 'fdt addr ${fdtaddr}; run fdtfixup_configid'
DIVA# setenv fdtfixup_configid 'fdt set / som_configid ${som_configid#}; fdt set / som_uniqueid ${som_uniqueid#}; fdt set / cb_configid ${cb_configid#}; fdt set / cb_uniqueid ${cb_uniqueid#}'
Linux[edit | edit source]

It is possible to read the ConfigID/UniqueID via procfs; for example:

root@axel-lite:~# cat /proc/device-tree/som/configid && echo
00000003
root@axel-lite:~# cat /proc/device-tree/som/uniqueid && echo
df646299:0b0579d4
root@axel-lite:~#

Legacy device tree, has a sightly different procfs structure:

root@axel-lite:~# cat /proc/device-tree/som_configid && echo
00000003
root@axel-lite:~# cat /proc/device-tree/som_uniqueid && echo
df646299:0b0579d4
root@axel-lite:~#

A real case example of ConfigID benefit[edit | edit source]

The ConfigID benefit is clear when:

  • there is a number of products deployed on the field
  • the products deployed on the field needs a SW update

The ideal scenario is that all products are equal and there are no differences on the Bill Of Material (BOM):

In this case there are no problems to deploy a new SW update on the field: all products have the same HW configuration, then the same SW configuration.

Unfortunately, this is an ideal scenario. The reality is that:

  • component obsolescence
  • product shortage
  • second source strategies

force to have an on-the-field different version of product (with same functionalities but with different HW configuration) which doesn't permit to realize what proposed in the ideal case.


200px-Emblem-important.svg.png

The usage of the ConfigID technique, allows the running SW to identify the underlying HW configuration and automatically adapt the BSP (i.e. the driver layer) to properly use the HW subsystems: this, maintaining the overall product features identical to the final User point-of-view.

With a scenario, like the one described above, if you would like to update the SW you need to implement a strategy for understanding what platform version is going to be updated. The Config ID is used exactly for this goal.

The ConfigID provides to the software update routine the information on which product version is so the update can be adapted to the exact product version.

In this way, you can distribute one single version of the software update which will automatically adapt itself to the currently running platform.

How to handle After Sales with Config ID[edit | edit source]

One of the mos common questions about Config ID is how to handle the Config ID issue. Below is described with an example how to handle it.

This product is returned from the field with a problem on the display:

Config ID A

After Sales Dept analizes the product and decide to substitute the display. The problem is that the existing display is not available - because of is End Of Life (EOL) - and it is required to move to a different display: in the product a different Config ID will be written because of the 2 displays requires a dedicated SW version and cannot be distinguished automatically during the startup. The final result is to have the similar product:

Config ID B

As indicated, the new display requires a different Config ID (from A to B) so it can be updated with an easy software routine before start the SW update. This Config ID update routine can be implemented in manufacturing facility typically using a dedicated USB pen drive which modify the saved ConfigID to the new one depending on the storage memory in use



ConfigID[edit | edit source]

This article describes how the ConfigID is implemented in the products supported by the DESK-MX6-L Linux Kit.

AXEL Lite[edit | edit source]

As AXEL Lite is a system-on-module (SOM), the typical mechanism described here is used.

Moreover, a system is composed of the combination of a SOM and a carrier board. In this case, two ConfigIDs are used to identify the actual board configuration like it was a SOM+carrier board system.

For the sake of simplicity, the first ConfigID is denoted as SOM ConfigID, while the second one is denoted as CB ConfigID:

...
SOM ConfigID#: 00000003
SOM UniqueID#: df646299:0b0579d4
CB ConfigID#: 00000012
CB UniqueID#: da000011:0dd2e72d
Board: MX6Q-AxelLite on SBCX
...

Generally speaking:

  • SOM ConfigID is used to identify the configuration of the basic features of the SOM
  • CB ConfigID is used to identify the peripherals and the I/O interfaces.


200px-Emblem-important.svg.png

NXP guarantees that processors UIDs (a.k.a. SOM UniqueID# on DESK-MX6-L) to be unique over the whole MX6 family



Booting from NFS[edit | edit source]

This configuration is very helpful during the software development (both for kernel and applications). The kernel image is downloaded via TFTP while the root file system is remotely mounted via NFS from the host. It is assumed that the development host:

  • is connected with the target host board through an Ethernet LAN
  • exports the directory containing the root file system for the target through the NFS server
  • runs a TFTP server.
  • has a proper subnet IP address

net_nfs configuration[edit | edit source]

DESK-MX6-L Virtual Machine is properly configured for the TFTP and NFS debug.

In any case, some variables has to be configured on the target and the VM itself has to be configured for respect to the network environment.

Host (Virtual Machine) configuration[edit | edit source]

The DESK-MX6-L Virtual Machine has the tftp and nfs services already running. Optionally, their configuration has to be changed according to the network configuration where the target is connected to.

Check and properly configure the items the following chapters: network adapter, nfs server

network adapter[edit | edit source]

The network adpater should be configured in bridge mode in order to allow the target to get the files from the VM


Network-bridge.png

then, modify the network interfaces configuration using the netplan configuration file, for example (sse Ubuntu network configuration):

dvdk@vagrant:~$ cat /etc/netplan/01-netcfg.yaml 
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: false
      addresses:
        - 192.168.0.125/24
      gateway4: 192.168.0.254
      nameservers:
          addresses: [8.8.8.8, 1.1.1.1]
dvdk@vagrant:~$ 

and restart it:

dvdk@vagrant:~$ sudo netplan apply
dvdk@vagrant:~$ 

Check or re-configure the Host IP address

dvdk@vagrant:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:b1:28:5d brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.125/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb1:285d/64 scope link 
       valid_lft forever preferred_lft forever
dvdk@vagrant:~$ 

nfs server[edit | edit source]

The NFS server should exports the correct file system directory (in our example)

dvdk@vagrant:~$ cat /etc/exports 
/home 0.0.0.0/0.0.0.0(rw,sync,no_root_squash,no_subtree_check,crossmnt)
dvdk@vagrant:~$ 

otherwise, change its configuration and then restart the nfs server:

dvdk@vagrant:~$ sudo systemctl restart nfs-kernel-server

Target configuration[edit | edit source]

The IP address for server and target should be configured: an example (for a network subnet 192.168.0.x)

=> setenv serverip 192.168.0.125
=> setenv ipaddr 192.168.0.90
  • serverip is the IP address of the host machine running the tftp/nfs server
  • ipaddr is the IP address of the target

The kernel and device tree files has to be selected

=> setenv bootfile desk-mx6-l/uImage
=> setenv fdtfile desk-mx6-l/imx6dl-sbcx-cb0012.dtb

finally, the root file system directory on the Virtual Machine should be configured for let the kernel to find the INIT

=> setenv rootpath /home/dvdk/desk-mx-l/rfs/desk-mx6-l


The kernel and device tree files and root file system directory name are already set on U-Boot environment.

To run this configuration just issue the net_nfs command which firstly download the kernel and device tree using the tftp protocol: click on Expand to see the complete network bootlog

=> run net_nfs
1152054 bytes read in 58 ms (18.9 MiB/s)
Using FEC device
TFTP from server 192.168.0.125; our IP address is 192.168.0.90
Filename 'desk-mx6-l/uImage'.
Load address: 0x12000000
Loading: #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##########
	 1.9 MiB/s
done
Bytes transferred = 8037400 (7aa418 hex)
Using FEC device
TFTP from server 192.168.0.167; our IP address is 192.168.0.165
Filename 'desk-mx6-l/imx6dl-sbcx-cb0012.dtb'.
Load address: 0x18000000
Loading: *�###########
	 1.7 MiB/s
done
Bytes transferred = 52247 (cc17 hex)
FDT: override 'som_uniqueid' with 'd57ea478:1e1b99d4'
FDT: override 'cb_uniqueid' with '7b000035:c3bf5b2d'
## Booting kernel from Legacy Image at 12000000 ...
   Image Name:   Linux-5.15.71-desk-mx6-l-4.0.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8037336 Bytes = 7.7 MiB
   Load Address: 10008000
   Entry Point:  10008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 18000000
   Booting using the fdt blob at 0x18000000
   Loading Kernel Image
   Using Device Tree in place at 18000000, end 1800ffff
switch to ldo_bypass mode!
Frame buffer: configure splashscreen reserved memory to 0x4fc00000 (2 MiB)
WARNING: could not find 2nd splashscreen reserved memory path

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.71-desk-mx6-l-4.0.0 (jenkins@focalbakery) (arm-poky-linux-gnueabi-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Mon Apr 3 18:04:15 CEST 2023
[    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: AxelLite DL on SBCX CB0012
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] OF: reserved mem: node linux,cma compatible matching fail
[    0.000000] Reserved memory: created ipuv3_fb memory pool at 0x4fc00000, size 2 MiB
[    0.000000] OF: reserved mem: initialized node splashscreen, compatible id fsl,ipuv3-fb
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000010000000-0x000000004fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000010000000-0x000000004fbfffff]
[    0.000000]   node   0: [mem 0x000000004fc00000-0x000000004fdfffff]
[    0.000000]   node   0: [mem 0x000000004fe00000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000010000000-0x000000004fffffff]
[    0.000000] percpu: Embedded 12 pages/cpu s17036 r8192 d23924 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.167:/home/dvdk/desk-mx-l/rfs/desk-mx6-l,v3,tcp ip=192.168.0.165:192.168.0.167::255.255.255.0:xelk:eth0:off panic=1 console=ttymxc2,115200 vmalloc=400M mtdparts=gpmi-nand:2M(nand-SPL),6M(nand-uboot),1M(nand-env1),1M(nand-env2),1M(nand-fdt),1M(nand-spare),8M(nand-kernel),4M(nand-splash),-(nand-ubi);spi0.0:64k(spi-SPL),960k(spi-uboot),256k(spi-env1),256k(spi-env2),512k(spi-dtb),8M(spi-kernel),4M(spi-splash),-(spi-free)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1019076K/1048576K available (12288K kernel code, 1358K rwdata, 2348K rodata, 1024K init, 407K bss, 29500K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] L2C-310 erratum 769419 enabled
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 ID prefetch enabled, offset 16 lines
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 16 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76450001
[    0.000000] Switching to timer-based delay loop, resolution 333ns
[    0.000000] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
[    0.000032] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[    0.001510] Console: colour dummy device 80x30
[    0.001553] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
[    0.001574] pid_max: default: 32768 minimum: 301
[    0.001739] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001770] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.002504] CPU: Testing write buffer coherency: ok
[    0.002566] CPU0: Spectre v2: using BPIALL workaround
[    0.002840] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003926] Setting up static identity map for 0x10100000 - 0x10100060
[    0.004121] rcu: Hierarchical SRCU implementation.
[    0.005441] smp: Bringing up secondary CPUs ...
[    0.006318] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.006336] CPU1: Spectre v2: using BPIALL workaround
[    0.006502] smp: Brought up 1 node, 2 CPUs
[    0.006524] SMP: Total of 2 processors activated (12.00 BogoMIPS).
[    0.006539] CPU: All CPU(s) started in SVC mode.
[    0.007054] devtmpfs: initialized
[    0.016881] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.017136] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.017166] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.017297] pinctrl core: initialized pinctrl subsystem
[    0.018692] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.020262] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.021370] thermal_sys: Registered thermal governor 'step_wise'
[    0.021380] thermal_sys: Registered thermal governor 'user_space'
[    0.021858] cpuidle: using governor menu
[    0.022059] CPU identified as i.MX6DL, silicon rev 1.3
[    0.022184] Use WDOG2 as reset source
[    0.040952] vdd1p1: supplied by regulator-dummy
[    0.041596] vdd3p0: supplied by regulator-dummy
[    0.042182] vdd2p5: supplied by regulator-dummy
[    0.043602] mxs_phy 20c9000.usbphy: supply phy-3p0 not found, using dummy regulator
[    0.044272] mxs_phy 20ca000.usbphy: supply phy-3p0 not found, using dummy regulator
[    0.055146] platform 21dc000.mipi: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi1_mux
[    0.055242] platform 21dc000.mipi: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi0_mux
[    0.058129] platform 2400000.ipu: Fixing up cyclic dependency with ldb
[    0.058214] platform 2400000.ipu: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi1_mux
[    0.058308] platform 2400000.ipu: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi0_mux
[    0.065672] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.065698] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.067095] imx6dl-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver
[    0.069441] imx mu driver is registered.
[    0.070035] imx rpmsg driver is registered.
[    0.104939] vgaarb: loaded
[    0.105773] SCSI subsystem initialized
[    0.106317] usbcore: registered new interface driver usbfs
[    0.106380] usbcore: registered new interface driver hub
[    0.106447] usbcore: registered new device driver usb
[    0.106607] usb_phy_generic usbphynop1: supply vcc not found, using dummy regulator
[    0.106813] usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests
[    0.106993] usb_phy_generic usbphynop2: supply vcc not found, using dummy regulator
[    0.107144] usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests
[    0.109073] i2c i2c-1: IMX I2C adapter registered
[    0.110055] i2c i2c-2: IMX I2C adapter registered
[    0.111084] mc: Linux media interface: v0.10
[    0.111136] videodev: Linux video capture interface: v2.00
[    0.111229] pps_core: LinuxPPS API ver. 1 registered
[    0.111242] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.111266] PTP clock support registered
[    0.139693] imx-ipuv3 2400000.ipu: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
[    0.141664] mxc_vdoa 21e4000.vdoa: i.MX Video Data Order Adapter(VDOA) driver probed
[    0.142256] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 driver probed
[    0.142277] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 dphy version is 0x3130302a
[    0.142727] MIPI CSI2 driver module loaded
[    0.142789] Advanced Linux Sound Architecture Driver Initialized.
[    0.144034] Bluetooth: Core ver 2.22
[    0.144096] NET: Registered PF_BLUETOOTH protocol family
[    0.144109] Bluetooth: HCI device and connection manager initialized
[    0.144130] Bluetooth: HCI socket layer initialized
[    0.144147] Bluetooth: L2CAP socket layer initialized
[    0.144173] Bluetooth: SCO socket layer initialized
[    0.144831] clocksource: Switched to clocksource mxc_timer1
[    0.145019] VFS: Disk quotas dquot_6.6.0
[    0.145095] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.154738] NET: Registered PF_INET protocol family
[    0.155183] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.156469] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.156515] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.156537] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.156630] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.156774] TCP: Hash tables configured (established 8192 bind 8192)
[    0.156954] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.157008] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.157210] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.157938] RPC: Registered named UNIX socket transport module.
[    0.157958] RPC: Registered udp transport module.
[    0.157968] RPC: Registered tcp transport module.
[    0.157979] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.158962] PCI: CLS 0 bytes, default 64
[    0.159649] armv7-pmu pmu: hw perfevents: no interrupt-affinity property, guessing.
[    0.159845] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    0.162093] Bus freq driver module loaded
[    0.163087] Initialise system trusted keyrings
[    0.163373] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[    0.168408] NFS: Registering the id_resolver key type
[    0.168506] Key type id_resolver registered
[    0.168519] Key type id_legacy registered
[    0.168572] ntfs: driver 2.1.32 [Flags: R/W].
[    0.168956] fuse: init (API version 7.34)
[    0.261863] Key type asymmetric registered
[    0.261888] Asymmetric key parser 'x509' registered
[    0.261960] io scheduler mq-deadline registered
[    0.261976] io scheduler kyber registered
[    0.264977] imx6q-pcie 1ffc000.pcie: supply epdev_on not found, using dummy regulator
[    0.270095] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[    0.270122] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: imx/sdma/sdma-imx6q.bin
[    0.272011] mxs-dma 110000.dma-apbh: initialized
[    0.276897] pfuze100-regulator 1-0008: Full layer: 2, Metal layer: 1
[    0.277630] pfuze100-regulator 1-0008: FAB: 0, FIN: 0
[    0.277648] pfuze100-regulator 1-0008: pfuze100 found.
[    0.285079] SW4: Bringing 3150000uV into 1800000-1800000uV
[    0.291681] VGEN3: Bringing 2800000uV into 2500000-2500000uV
[    0.293173] VGEN4: Bringing 3000000uV into 1800000-1800000uV
[    0.294660] VGEN5: Bringing 3000000uV into 2800000-2800000uV
[    0.298233] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.300686] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 78, base_baud = 5000000) is a IMX
[    0.301529] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 79, base_baud = 5000000) is a IMX
[    0.314935] imx6q-pcie 1ffc000.pcie: iATU unroll: disabled
[    0.323469] printk: console [ttymxc2] enabled
[    0.330535] imx6q-pcie 1ffc000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    0.339119] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 80, base_baud = 5000000) is a IMX
[    0.344096] imx6q-pcie 1ffc000.pcie: host bridge /soc/pcie@1ffc000 ranges:
[    0.349646] 21f4000.serial: ttymxc4 at MMIO 0x21f4000 (irq = 81, base_baud = 5000000) is a IMX
[    0.355245] imx6q-pcie 1ffc000.pcie:       IO 0x0001f80000..0x0001f8ffff -> 0x0000000000
[    0.364691] imx sema4 driver is registered.
[    0.370952] imx6q-pcie 1ffc000.pcie:      MEM 0x0001000000..0x0001efffff -> 0x0001000000
[    1.378805] imx6q-pcie 1ffc000.pcie: iATU unroll: disabled
[    1.384312] imx6q-pcie 1ffc000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    1.388257] brd: module loaded
[    1.402561] loop: module loaded
[    1.406835] imx ahci driver is registered.
[    1.413536] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xd3
[    1.419941] nand: AMD/Spansion S34ML08G1
[    1.423871] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.431827] Scanning device for bad blocks
[    1.491945] imx6q-pcie 1ffc000.pcie: Link up
[    1.496292] imx6q-pcie 1ffc000.pcie: Link: Gen2 disabled
[    1.501628] imx6q-pcie 1ffc000.pcie: Link up, Gen1
[    1.624890] imx6q-pcie 1ffc000.pcie: Link up
[    1.629418] imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
[    1.635742] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.641256] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    1.647479] pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
[    1.654420] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
[    1.660482] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[    1.666805] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[    1.673563] pci 0000:00:00.0: Limiting cfg_size to 512
[    1.678790] pci 0000:00:00.0: supports D1
[    1.682832] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
[    1.694249] PCI: bus0: Fast back to back transfers disabled
[    1.700199] pci 0000:01:00.0: [8086:08b1] type 00 class 0x028000
[    1.706358] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00001fff 64bit]
[    1.713717] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    1.749639] PCI: bus1: Fast back to back transfers disabled
[    1.755310] pci 0000:00:00.0: BAR 0: assigned [mem 0x01000000-0x010fffff]
[    1.762134] pci 0000:00:00.0: BAR 8: assigned [mem 0x01100000-0x011fffff]
[    1.768973] pci 0000:00:00.0: BAR 6: assigned [mem 0x01200000-0x0120ffff pref]
[    1.776246] pci 0000:01:00.0: BAR 0: assigned [mem 0x01100000-0x01101fff 64bit]
[    1.783628] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    1.788898] pci 0000:00:00.0:   bridge window [mem 0x01100000-0x011fffff]
[    2.270333] Bad eraseblock 3499 at 0x00001b560000
[    2.649841] random: crng init done
[    3.147591] Bad eraseblock 7942 at 0x00003e0c0000
[    3.152573] Bad eraseblock 7944 at 0x00003e100000
[    3.205411] 9 cmdlinepart partitions found on MTD device gpmi-nand
[    3.211602] Creating 9 MTD partitions on "gpmi-nand":
[    3.216695] 0x000000000000-0x000000200000 : "nand-SPL"
[    3.223362] 0x000000200000-0x000000800000 : "nand-uboot"
[    3.230192] 0x000000800000-0x000000900000 : "nand-env1"
[    3.236938] 0x000000900000-0x000000a00000 : "nand-env2"
[    3.243610] 0x000000a00000-0x000000b00000 : "nand-fdt"
[    3.250271] 0x000000b00000-0x000000c00000 : "nand-spare"
[    3.257063] 0x000000c00000-0x000001400000 : "nand-kernel"
[    3.263925] 0x000001400000-0x000001800000 : "nand-splash"
[    3.270816] 0x000001800000-0x000040000000 : "nand-ubi"
[    3.281008] gpmi-nand 112000.nand-controller: driver registered.
[    3.288013] SPI driver spidev has no spi_device_id for spidev
[    3.293771] SPI driver spidev has no spi_device_id for dave,sbcx-exp
[    3.301118] spinor@0 enforce active low on chipselect handle
[    3.307625] spi-nor spi0.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[    3.314519] spi-nor: probe of spi0.0 failed with error -2
[    3.320566] spidev@0 enforce active low on chipselect handle
[    3.329245] tun: Universal TUN/TAP device driver, 1.6
[    3.334518] CAN device driver interface
[    3.342322] pps pps0: new PPS source ptp0
[    3.349702] fec 2188000.ethernet eth0: registered PHC device 0
[    3.356978] usbcore: registered new interface driver asix
[    3.362432] usbcore: registered new interface driver ax88179_178a
[    3.368655] usbcore: registered new interface driver cdc_ether
[    3.374532] usbcore: registered new interface driver cdc_eem
[    3.380306] usbcore: registered new interface driver net1080
[    3.386046] usbcore: registered new interface driver cdc_subset
[    3.392006] usbcore: registered new interface driver zaurus
[    3.397707] usbcore: registered new interface driver cdc_ncm
[    3.403410] usbcore: registered new interface driver cdc_mbim
[    3.409228] usbcore: registered new interface driver r8153_ecm
[    3.415120] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.421680] ehci-pci: EHCI PCI platform driver
[    3.426295] usbcore: registered new interface driver cdc_wdm
[    3.432009] usbcore: registered new interface driver usb-storage
[    3.443371] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[    3.449555] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-07T01:25:43 UTC (523543)
[    3.459232] i2c_dev: i2c /dev entries driver
[    3.464660] i2c i2c-1: Added multiplexed i2c bus 4
[    3.471518] input: TSC2007 Touchscreen as /devices/platform/soc/2100000.bus/21a4000.i2c/i2c-1/i2c-5/5-0048/input/input0
[    3.483157] i2c i2c-1: Added multiplexed i2c bus 5
[    3.488037] i2c-mux-gpio i2c2mux: 2 port mux on 21a4000.i2c adapter
[    3.495946] pwm-backlight backlight: supply power not found, using dummy regulator
[    3.506146] mxc_hdmi 20e0000.hdmi_video: supply HDMI not found, using dummy regulator
[    3.515697] mxc_sdc_fb fb@0: registered mxc display driver ldb
[    3.521612] mxc_sdc_fb fb@0: using reserved memory region at 0x4fc00000, size 2 MiB
[    3.529367] mxc_sdc_fb fb@0: assigned reserved memory node splashscreen
[    3.536170] mxc_sdc_fb fb@0: using memory region 0x4fc00000 0x4fdfffff
[    3.820348] VGEN3: voltage operation not allowed
[    4.184871] camera ov5640_mipi is found
[    4.189328] mxc_v4l2_output v4l2_out: V4L2 device registered as video16
[    4.196138] mxc_v4l2_output v4l2_out: V4L2 device registered as video17
[    4.203725] Bluetooth: HCI UART driver ver 2.3
[    4.208222] Bluetooth: HCI UART protocol H4 registered
[    4.213372] Bluetooth: HCI UART protocol BCSP registered
[    4.218742] Bluetooth: HCI UART protocol LL registered
[    4.224457] sdhci: Secure Digital Host Controller Interface driver
[    4.230674] sdhci: Copyright(c) Pierre Ossman
[    4.235051] sdhci-pltfm: SDHCI platform and OF driver helper
[    4.242082] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    4.244294] caam 2100000.crypto: Entropy delay = 3200
[    4.265773] caam 2100000.crypto: Instantiated RNG4 SH0
[    4.278249] caam 2100000.crypto: Instantiated RNG4 SH1
[    4.283497] caam 2100000.crypto: device ID = 0x0a16010000000100 (Era 4)
[    4.283599] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    4.290154] caam 2100000.crypto: job rings = 2, qi = 0
[    4.321786] caam algorithms registered in /proc/crypto
[    4.328763] caam 2100000.crypto: rng crypto API alg registered prng-caam
[    4.331974] mmc0: host does not support reading read-only switch, assuming write-enable
[    4.335534] caam 2100000.crypto: registering rng-caam
[    4.347469] mmc0: new high speed SDHC card at address aaaa
[    4.355176] mmcblk0: mmc0:aaaa SA32G 29.7 GiB 
[    4.355563] Device caam-keygen registered
[    4.366688]  mmcblk0: p1 p2
[    4.370481] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[    4.379025] usbcore: registered new interface driver usbhid
[    4.384611] usbhid: USB HID core driver
[    4.395730] fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW
[    4.416374] NET: Registered PF_INET6 protocol family
[    4.422697] Segment Routing with IPv6
[    4.426460] In-situ OAM (IOAM) with IPv6
[    4.430482] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    4.437116] NET: Registered PF_PACKET protocol family
[    4.442194] can: controller area network core
[    4.446705] NET: Registered PF_CAN protocol family
[    4.449124] mmc1: SDHCI controller on 2194000.mmc [2194000.mmc] using ADMA
[    4.451506] can: raw protocol
[    4.461410] can: broadcast manager protocol
[    4.465644] can: netlink gateway - max_hops=1
[    4.470284] Bluetooth: RFCOMM TTY layer initialized
[    4.475264] Bluetooth: RFCOMM socket layer initialized
[    4.480210] mmc1: queuing unknown CIS tuple 0x01 [d9 01 ff] (3 bytes)
[    4.480440] Bluetooth: RFCOMM ver 1.11
[    4.490673] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.495081] mmc1: queuing unknown CIS tuple 0x1a [01 01 00 02 07] (5 bytes)
[    4.496012] Bluetooth: BNEP filters: protocol multicast
[    4.506518] mmc1: queuing unknown CIS tuple 0x1b [c1 41 30 30 ff ff 32 00] (8 bytes)
[    4.508200] Bluetooth: BNEP socket layer initialized
[    4.516666] mmc1: queuing unknown CIS tuple 0x14 [] (0 bytes)
[    4.520902] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    4.529671] mmc1: new high speed SDIO card at address 0001
[    4.532586] Bluetooth: HIDP socket layer initialized
[    4.543116] 8021q: 802.1Q VLAN Support v1.8
[    4.547364] lib80211: common routines for IEEE802.11 drivers
[    4.553588] rfkill_gpio bt_rfkill: bt_rfkill device registered.
[    4.559718] Key type dns_resolver registered
[    4.564753] Registering SWP/SWPB emulation handler
[    4.569806] Loading compiled-in X.509 certificates
[    4.603541] vddarm: bypassed regulator has no supply!
[    4.608652] vddarm: failed to get the current voltage: -EPROBE_DEFER
[    4.615060] vddarm: supplied by SW1AB
[    4.619552] vddpu: supplied by SW1C
[    4.623316] vddsoc: bypassed regulator has no supply!
[    4.628413] vddsoc: failed to get the current voltage: -EPROBE_DEFER
[    4.634789] vddsoc: supplied by SW1C
[    4.650011] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    4.655041] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    4.684862] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    4.690539] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    4.698879] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.706153] usb usb1: Product: EHCI Host Controller
[    4.711041] usb usb1: Manufacturer: Linux 5.15.71-desk-mx6-l-4.0.0 ehci_hcd
[    4.718050] usb usb1: SerialNumber: ci_hdrc.1
[    4.723105] hub 1-0:1.0: USB hub found
[    4.726933] hub 1-0:1.0: 1 port detected
[    4.732934] galcore: clk_get vg clock failed, disable vg!
[    4.739339] Galcore version 6.4.3.p4.398061
[    4.880105] [drm] Initialized vivante 1.0.0 20170808 for 130000.gpu on minor 0
[    4.889128] mxc_vpu 2040000.vpu_fsl: VPU initialized
[    4.896767] imx_thermal 20c8000.anatop:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[    4.907552] Hot alarm is canceled. GPU3D clock will return to 64/64
[    4.933919] imx_epdc_fb 20f4000.epdc: can't get/select pinctrl
[    5.028305] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:07, irq=POLL)
[    7.115394] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    7.134953] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    7.164920] IP-Config: Complete:
[    7.168174]      device=eth0, hwaddr=32:91:96:65:f9:b8, ipaddr=192.168.0.165, mask=255.255.255.0, gw=255.255.255.255
[    7.178931]      host=xelk, domain=, nis-domain=(none)
[    7.184103]      bootserver=192.168.0.167, rootserver=192.168.0.167, rootpath=
[    7.184439] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    7.204128] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    7.211234] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    7.220744] ALSA device list:
[    7.223740]   #0: sbcx-audio-tlv320aic3100
[    7.228107] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    7.283586] VFS: Mounted root (nfs filesystem) on device 0:14.
[    7.294800] devtmpfs: mounted
[    7.301196] Freeing unused kernel image (initmem) memory: 1024K
[    7.325727] Run /sbin/init as init process
[    7.916979] systemd[1]: System time before build time, advancing clock.
[    7.957056] systemd[1]: systemd 250.5+ running in system mode (-PAM -AUDIT -SELINUX -APPARMOR +IMA -SMACK +SECCOMP -GCRYPT -GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -BZIP2 -LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=hybrid)
[    7.989605] systemd[1]: Detected architecture arm.

Welcome to NXP i.MX Release Distro 5.15-kirkstone (kirkstone)!

[    8.041227] systemd[1]: Hostname set to <desk-mx6>.
[    8.246912] systemd-sysv-generator[184]: SysV service '/etc/init.d/single' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.307259] systemd-sysv-generator[184]: SysV service '/etc/init.d/halt' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.351573] systemd-sysv-generator[184]: SysV service '/etc/init.d/sendsigs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.378863] systemd-sysv-generator[184]: SysV service '/etc/init.d/umountfs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.412370] systemd-sysv-generator[184]: SysV service '/etc/init.d/alignment.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.442092] systemd-sysv-generator[184]: SysV service '/etc/init.d/rc.local' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.467572] systemd-sysv-generator[184]: SysV service '/etc/init.d/reboot' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.494613] systemd-sysv-generator[184]: SysV service '/etc/init.d/umountnfs.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.520862] systemd-sysv-generator[184]: SysV service '/etc/init.d/save-rtc.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    8.582466] systemd[175]: /lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.
[    9.618764] systemd[1]: Queued start job for default target Multi-User System.
[    9.630514] systemd[1]: Created slice Slice /system/getty.
[  OK  ] Created slice Slice /system/getty.
[    9.666853] systemd[1]: Created slice Slice /system/modprobe.
[  OK  ] Created slice Slice /system/modprobe.
[    9.707865] systemd[1]: Created slice Slice /system/serial-getty.
[  OK  ] Created slice Slice /system/serial-getty.
[    9.747004] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[    9.786116] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[    9.825968] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[    9.866372] systemd[1]: Reached target Host and Network Name Lookups.
[  OK  ] Reached target Host and Network Name Lookups.
[    9.905390] systemd[1]: Reached target Path Units.
[  OK  ] Reached target Path Units.
[    9.935542] systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
[    9.975450] systemd[1]: Reached target Slice Units.
[  OK  ] Reached target Slice Units.
[   10.005633] systemd[1]: Reached target Swaps.
[  OK  ] Reached target Swaps.
[   10.042114] systemd[1]: Listening on RPCbind Server Activation Socket.
[  OK  ] Listening on RPCbind Server Activation Socket.
[   10.075548] systemd[1]: Reached target RPC Port Mapper.
[  OK  ] Reached target RPC Port Mapper.
[   10.119903] systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
[   10.156305] systemd[1]: Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[   10.256487] systemd[1]: Journal Audit Socket was skipped because of a failed condition check (ConditionSecurity=audit).
[   10.269045] systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
[   10.307050] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[   10.348551] systemd[1]: Listening on Network Service Netlink Socket.
[  OK  ] Listening on Network Service Netlink Socket.
[   10.391578] systemd[1]: Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
[   10.426745] systemd[1]: Listening on udev Kernel Socket.
[  OK  ] Listening on udev Kernel Socket.
[   10.467836] systemd[1]: Listening on User Database Manager Socket.
[  OK  ] Listening on User Database Manager Socket.
[   10.506632] systemd[1]: Huge Pages File System was skipped because of a failed condition check (ConditionPathExists=/sys/kernel/mm/hugepages).
[   10.520788] systemd[1]: POSIX Message Queue File System was skipped because of a failed condition check (ConditionPathExists=/proc/sys/fs/mqueue).
[   10.541960] systemd[1]: Mounting Kernel Debug File System...
         Mounting Kernel Debug File System...
[   10.577036] systemd[1]: Kernel Trace File System was skipped because of a failed condition check (ConditionPathExists=/sys/kernel/tracing).
[   10.604010] systemd[1]: Mounting Temporary Directory /tmp...
         Mounting Temporary Directory /tmp...
[   10.638407] systemd[1]: Create List of Static Device Nodes was skipped because of a failed condition check (ConditionFileNotEmpty=/lib/modules/5.15.71-desk-mx6-l-4.0.0/modules.devname).
[   10.665326] systemd[1]: Starting Load Kernel Module configfs...
         Starting Load Kernel Module configfs...
[   10.706855] systemd[1]: Starting Load Kernel Module drm...
         Starting Load Kernel Module drm...
[   10.751458] systemd[1]: Starting Load Kernel Module fuse...
         Starting Load Kernel Module fuse...
[   10.797447] systemd[1]: Starting RPC Bind...
         Starting RPC Bind...
[   10.839301] systemd[1]: File System Check on Root Device was skipped because of a failed condition check (ConditionPathIsReadWrite=!/).
[   10.853960] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[   10.867032] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[   10.879444] systemd[1]: Starting Journal Service...
         Starting Journal Service...
[   10.937041] systemd[1]: Load Kernel Modules was skipped because all trigger condition checks failed.
[   10.951016] systemd[1]: Starting Generate network units from Kernel command line...
         Starting Generate network …ts from Kernel command line...
[   11.003651] systemd[1]: Starting Remount Root and Kernel File Systems...
         Starting Remount Root and Kernel File Systems...
[   11.049746] systemd[1]: Starting Apply Kernel Variables...
         Starting Apply Kernel Variables...
[   11.098154] systemd[1]: Starting Coldplug All udev Devices...
         Starting Coldplug All udev Devices...
[   11.172565] systemd[1]: Started RPC Bind.
[  OK  ] Started RPC Bind.
[   11.218103] systemd[1]: Mounted Kernel Debug File System.
[  OK  ] Mounted Kernel Debug File System.
[   11.236271] systemd[1]: Mounted Temporary Directory /tmp.
[  OK  ] Mounted Temporary Directory /tmp.
[   11.256985] systemd[1]: modprobe@configfs.service: Deactivated successfully.
[   11.275912] systemd[1]: Finished Load Kernel Module configfs.
[  OK  ] Finished Load Kernel Module configfs.
[   11.317000] systemd[1]: modprobe@drm.service: Deactivated successfully.
[   11.335630] systemd[1]: Finished Load Kernel Module drm.
[  OK  ] Finished Load Kernel Module drm.
[   11.377088] systemd[1]: modprobe@fuse.service: Deactivated successfully.
[   11.395652] systemd[1]: Finished Load Kernel Module fuse.
[  OK  ] Finished Load Kernel Module fuse.
[   11.436772] systemd[1]: Finished Generate network units from Kernel command line.
[  OK  ] Finished Generate network units from Kernel command line.
[   11.486737] systemd[1]: Finished Remount Root and Kernel File Systems.
[  OK  ] Finished Remount Root and Kernel File Systems.
[   11.525808] systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Finished Apply Kernel Variables.
         Mounting FUSE Control File System...
         Mounting Kernel Configuration File System...
         Starting Flush Journal to Persistent Storage...
         Starting Create Static Device Nodes in /dev...
[   11.762901] systemd-journald[192]: Received client request to flush runtime journal.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Mounted Kernel Configuration File System.
[  OK  ] Finished Flush Journal to Persistent Storage.
[  OK  ] Finished Create Static Device Nodes in /dev.
[  OK  ] Reached target Preparation for Local File Systems.
         Mounting /var/volatile...
         Starting Rule-based Manage…for Device Events and Files...
[  OK  ] Mounted /var/volatile.
         Starting Load/Save Random Seed...
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
[  OK  ] Finished Coldplug All udev Devices.
[  OK  ] Finished Load/Save Random Seed.
[  OK  ] Started Rule-based Manager for Device Events and Files.
[  OK  ] Finished Create Volatile Files and Directories.
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
[  OK  ] Reached target System Time Set.
         Starting Record System Boot/Shutdown in UTMP...
[  OK  ] Stopped Network Time Synchronization.
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
[  OK  ] Finished Record System Boot/Shutdown in UTMP.
[  OK  ] Stopped Network Time Synchronization.
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timer Units.
[   13.308002] mtdblock: MTD device 'nand-SPL' is NAND, please consider using UBI block devices instead.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[   13.336362] mtdblock: MTD device 'nand-env1' is NAND, please consider using UBI block devices instead.
[   13.340860] mtdblock: MTD device 'nand-uboot' is NAND, please consider using UBI block devices instead.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[   13.377647] mtdblock: MTD device 'nand-env2' is NAND, please consider using UBI block devices instead.
         Starting sshd.socket...
[   13.416268] mtdblock: MTD device 'nand-fdt' is NAND, please consider using UBI block devices instead.
[   13.601631] mtdblock: MTD device 'nand-spare' is NAND, please consider using UBI block devices instead.
[   13.704748] mtdblock: MTD device 'nand-kernel' is NAND, please consider using UBI block devices instead.
[  OK  ] Listening on sshd.socket.
[   13.743782] mtdblock: MTD device 'nand-splash' is NAND, please consider using UBI block devices instead.
[  OK  ] Created slice Slice /system/systemd-backlight.
[  OK  ] Reached target Socket Units.
[   14.056270] mtdblock: MTD device 'nand-ubi' is NAND, please consider using UBI block devices instead.
[  OK  ] Reached target Basic System.
[  OK  ] Started Job spooling tools.
[  OK  ] Started Periodic Command Scheduler.
         Starting D-Bus System Message Bus...
[  OK  ] Started Linux Firmware Loader Daemon.
[  OK  ] Started Configuration for i.MX GPU (Former rc_gpu.S).
         Starting IPv6 Packet Filtering Framework...
         Starting IPv4 Packet Filtering Framework...
         Starting Network Time Service (one-shot ntpdate mode)...
         Starting Telephony service...
[  OK  ] Started System Logging Service.
[   14.685678] imx-sdma 20ec000.sdma: firmware found.
         Starting Load/Save Screen …ness of backlight:backlight...
[   14.718755] imx-sdma 20ec000.sdma: loaded firmware 3.6
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Stopped Network Time Synchronization.
syslogd[313]: Error opening log file: /var/log/auth.log: No such file or directory
syslogd[313]: Error opening log file: /var/log/syslog: No such file or directory
syslogd[313]: Error opening log file: /var/log/kern.log: No such file or directory
syslogd[313]: Error opening log file: /var/log/mail.log: No such file or directory
syslogd[313]: Error opening log file: /var/log/mail.err: No such file or directory
syslogd[313]: Error opening log file: /var/log/messages: No such file or directory
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
         Starting OpenSSH Key Generation...
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Finished IPv6 Packet Filtering Framework.
[  OK  ] Finished IPv4 Packet Filtering Framework.
[  OK  ] Finished Network Time Service (one-shot ntpdate mode).
[  OK  ] Finished Load/Save Screen …htness of backlight:backlight.
[  OK  ] Started Telephony service.
[  OK  ] Finished OpenSSH Key Generation.
[  OK  ] Reached target Preparation for Network.
[  OK  ] Reached target Hardware activated USB gadget.
         Starting Save/Restore Sound Card State...
         Starting Connection service...
[  OK  ] Stopped User Login Management.
         Starting Load Kernel Module drm...
         Starting Network Configuration...
[  OK  ] Stopped Network Time Synchronization.
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Finished Save/Restore Sound Card State.
[  OK  ] Started Connection service.
[  OK  ] Reached target Sound Card.
[  OK  ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
         Starting Avahi mDNS/DNS-SD Stack...
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Stopped Network Time Synchronization.
[FAILED] Failed to start Network Time Synchronization.
See 'systemctl status systemd-timesyncd.service' for details.
[  OK  ] Started Network Configuration.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[FAILED] Failed to start Hostname Service.
See 'systemctl status systemd-hostnamed.service' for details.
[  OK  ] Stopped User Login Management.
         Starting Load Kernel Module drm...
         Starting Load/Save RF Kill Switch Status...
         Starting WPA supplicant...
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Started Load/Save RF Kill Switch Status.
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Stopped User Login Management.
         Starting Load Kernel Module drm...
[  OK  ] Started WPA supplicant.
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Reached target Network.
[  OK  ] Started NFS status monitor for NFSv2/3 locking..
[FAILED] Failed to start Respond to IPv6 Node Information Queries.
See 'systemctl status ninfod.service' for details.
         Starting /etc/rc.local Compatibility...
[FAILED] Failed to start Network Router Discovery Daemon.
See 'systemctl status rdisc.service' for details.
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Started /etc/rc.local Compatibility.
[  OK  ] Started Getty on tty1.
[  OK  ] Started Serial Getty on ttymxc2.
[  OK  ] Reached target Login Prompts.
[  OK  ] Stopped User Login Management.
         Starting Load Kernel Module drm...
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Created slice Slice /system/systemd-fsck.
         Starting File System Check on /dev/mmcblk0p1...
         Starting File System Check on /dev/mmcblk0p2...
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Reached target Multi-User System.
         Starting Record Runlevel Change in UTMP...
[  OK  ] Stopped User Login Management.
         Starting Load Kernel Module drm...
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Finished Record Runlevel Change in UTMP.
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[  OK  ] Finished File System Check on /dev/mmcblk0p2.
         Mounting /run/media/root-mmcblk0p2...
[   22.602715] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[  OK  ] Mounted /run/media/root-mmcblk0p2.
[  OK  ] Finished File System Check on /dev/mmcblk0p1.
         Mounting /run/media/boot-mmcblk0p1...
[  OK  ] Mounted /run/media/boot-mmcblk0p1.

NXP i.MX Release Distro 5.15-kirkstone desk-mx6 ttymxc2

desk-mx6 login: root
root@desk-mx6:~# uname -a
Linux desk-mx6 5.15.71-desk-mx6-l-4.0.0 #1 SMP PREEMPT Mon Apr 3 18:04:15 CEST 2023 armv7l armv7l armv7l GNU/Linux
root@desk-mx6:~# 

Development[edit | edit source]

Synchronizing the repository[edit | edit source]

In DESK-MX6-L the following source trees are clones of the correspondent DAVE Embedded Systems git repositories:

Component GIT Remote
U-Boot git@git.dave.eu:desk-mx-l/u-boot-imx.git
Linux kernel git@git.dave.eu:desk-mx-l/linux-imx.git
Yocto BSP git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git

For more information about the access to these repositories, please refer to this link.

Access to DAVE Embedded Systems' git repositories is granted to development kit's owners only. Please refer to this page for detailed instructions on how to get access.

Instructions[edit | edit source]

The components listed in the table above can be kept in sync and up to date with DAVE Embedded Systems' repositories.

Once the git account has been enabled, the developer can:

  • clone the repository with the git clone <git_remote_repository> command
  • synchronize a source tree entering the repository directory and launching the git fetch origin command.

Please note that git fetch doesn't merge the commits on the current branch. To do that, the developer should run the git merge command or replace the fetch-merge process with a single git pull command. Please note that the recommended method is the fetch-merge process. For further information on Git, please refer to the official Git Documentation



Building U-Boot[edit | edit source]

Quick reference[edit | edit source]

Repository Information
URL git@git.dave.eu:desk-mx-l/u-boot-imx.git
stable branch desk-mx6-l-4.x.x
stable tag desk-mx6-l-4.0.0

U-Boot defconfigs
Platform SOM ConfigID CB ConfigID Building-U-Boot
SBCX 0x00000003 0x00000012 mx6qdldesk_defconfig

Instructions[edit | edit source]

It is assumed that the development environment has been set up properly as described here.

  • start the Linux development VM and login into the system
  • open a terminal window and cd into U-Boot source code
cd ~/desk-mx-l/u-boot
  • in case of needs you can update your local repository with the following git command
git pull
  • configure the build environment
source ~/desk-mx-l/desk-mx6-l-4.0.0_env.sh
  • enter the source tree directory and run the following commands:
make mx6qdldesk_defconfig
make

NOTE: this is the default configuration suitable for latest AXEL Lite target.

The former command selects the default DESK-MX6-L configuration suitable for latest AXEL Lite targets (for additional defconfig please refer to the U-Boot defconfigs table above), while the latter builds the U-Boot binary image files (SPL and u-boot.img).

Binary files can be copied to the tftp root directory /tftpboot/desk-mx-l/ with the following command:

cp SPL u-boot.img /tftpboot/desk-mx-l/

Please refer to this page for more information on how to update the bootloader on your board.




Building Linux[edit | edit source]

Quick reference[edit | edit source]

Repository Information
URL git@git.dave.eu:desk-mx-l/linux-imx.git
stable branch desk-mx6-l-4.x.x
stable tag desk-mx6-l-4.0.0

Build Information
defconfig imx_v7_desk_defconfig
Kernel binary UIMAGE_LOADADDR=0x10008000 uImage
Platform DTB
SBCX imx6dl-sbcx-cb0012.dtb

Instructions[edit | edit source]

It is assumed that the development environment has been set up properly as described here.

  • start the Linux development VM and login into the system
  • open a terminal window and cd into Linux kernel source code
cd ~/desk-mx-l/linux
  • in case of needs you can update your local repository with the following git command
git pull
  • configure the build environment
source ~/desk-mx-l/desk-mx6-l-4.0.0_env.sh
  • enter the source tree directory and run the following commands:
make imx_v7_desk_defconfig
make UIMAGE_LOADADDR=0x10008000 uImage imx6dl-sbcx-cb0012.dtb

NOTE: this is the default configuration suitable for latest target.

The former command selects the default DESK-MX6-L configuration, while the latter builds the kernel binary image with the required U-Boot header and the kernel device tree.

Default Linux kernel configuration can be changed by using the standard menuconfig, xconfig, or gconfig make target. Subsequent builds just require uImage make target to update the binary image. Once the build process is complete, the kernel binary image is stored into the arch/arm/boot/uImage file. Both this file and the kernel device tree can be copied to the tftp root directory /tftpboot/desk-mx-l/ with the following commands:

cp arch/arm/boot/uImage /tftpboot/desk-mx-l/
cp arch/arm/boot/dts/*.dtb /tftpboot/desk-mx-l/

Usually, kernel modules are installed with make modules_install command, but this method installs the modules into the /lib/modules directory of your MVM, which is not what you want.

A better way to deploy kernel modules while cross-compiling is

  • generate a .tar.gz archive
  • install this archive into the target root file system

User can create such an archive, for example, using the following commands:

make modules
mkdir modules-install
make INSTALL_MOD_PATH=modules-install modules_install

cd modules-install && tar cvzf ../modules.tar.gz . && cd ..

Now copy modules.tar.gz into the target root file system and install them as root with the following command

tar xvzf modules.tar.gz -C /


Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer
URL git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git git@git.dave.eu:desk-mx-l/meta-desk-mx.git
stable branch kirkstone kirkstone
stable tag desk-mx6-l-4.0.0 desk-mx6-l-4.0.0
Build targets
Name Description
dave-image-devel This image include tools for development/debugging
desk-image-x11 This image include a X11 graphic backend
desk-image-qt6 This image include a Qt6 graphic backend with OpenGL ES accelerated framebuffer

Introduction[edit | edit source]

As known, in addition to a bootloader and the o.s. kernel, an embedded Linux system needs a root file system to operate. The root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the /sbin/init, the first user space process and "father" of all the other processes. For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.

desk-mx-l provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the dave-image-devel image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: /home/dvdk/desk-mx-l/rfs/<kit_name>.

Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the dnf tool. Please refer to this section for more details.

To generate the supported root file systems, the build of the Yocto BSP has to be run. The output of this process is an image containing the U-Boot binary file, the Linux kernel image, and the selected root file system image. The following sections describe in detail how to execute this operation.

For more general information regarding the Yocto build system, please refer the dedicated category page.

How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image[edit | edit source]

200px-Emblem-important.svg.png

The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to this page for detailed instructions on how to get it.


200px-Emblem-important.svg.png

This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine. For more details on this topic, please refer to the NXP documentation on this BSP, i.e. the i.MX Yocto Project User's Guide, which talks about the host setup for the Yocto build system.

Initialize the build environment[edit | edit source]

Before running the build, the environment must be initialized properly.

DESK-MX6-L Yocto BSP uses git-repo tool to fetch all the required git repositories. To install it, please use the following commands:

dvdk@vagrant:~/desk-mx-l$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo-1 > repo
dvdk@vagrant:~/desk-mx-l$ chmod a+x repo
dvdk@vagrant:~/desk-mx-l$ ./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx6-l-4.0.0
dvdk@vagrant:~/desk-mx-l$ ./repo sync
unautheticated git protocol error[edit | edit source]
200px-Emblem-important.svg.png

Since March 15th, 2022, GitHub stopped accepting DSA keys. RSA keys uploaded after Nov 2, 2021 will work only with SHA-2 signatures. The deprecated MACs, ciphers, and unencrypted Git protocol are permanently disabled.
For more details on this topic, please refer to this Technical Note.

Running the build[edit | edit source]

Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 80GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:

  • Migrating the build system to a physical machine
  • Assuming that the host system has the required resources, extending the hardware capabilities of the default MVM (e.g. adding more cores and disk space).

Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:

dvdk@vagrant:~/desk-mx-l$ DISTRO=fsl-imx-x11 MACHINE=desk-mx6 source desk-setup-release.sh -b build-x11
dvdk@vagrant:~/desk-mx-l/build-x11$ bitbake desk-image-x11

Where <target-image-name> is one of the images listed in here.

Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in build-x11/tmp/deploy/images/desk-mx6 using the environment prepared as stated above.

Generating the SDKs[edit | edit source]

After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:

bitbake <target-image-name> -c populate-sdk

Again, replace <target-image-name> with one of the images listed in here.

Building additional packages[edit | edit source]

To build additional packages the user must first select the DISTRO and source the desk-setup-release.sh script

dvdk@vagrant:~/desk-mx-l$ DISTRO=fsl-imx-x11 MACHINE=desk-mx6 source desk-setup-release.sh -b build-x11

And then can run any of the bitbake command.

dvdk@vagrant:~/desk-mx-l/build-x11$ bitbake canutils

The resulting packages (the default format is rpm) can be found inside build-x11/tmp/deploy/rpm.

dvdk@vagrant:~/desk-mx-l/build-x11$ ls tmp/deploy/rpm/cortexa9t2hf_neon/canutils-* -1
tmp/deploy/rpm/cortexa9t2hf_neon/canutils-4.0.6-r0.cortexa9t2hf_neon.rpm
tmp/deploy/rpm/cortexa9t2hf_neon/canutils-dbg-4.0.6-r0.cortexa9t2hf_neon.rpm
tmp/deploy/rpm/cortexa9t2hf_neon/canutils-dev-4.0.6-r0.cortexa9t2hf_neon.rpm
tmp/deploy/rpm/cortexa9t2hf_neon/canutils-doc-4.0.6-r0.cortexa9t2hf_neon.rpm
tmp/deploy/rpm/cortexa9t2hf_neon/canutils-src-4.0.6-r0.cortexa9t2hf_neon.rpm


How to create a bootable SD card[edit | edit source]

200px-Emblem-important.svg.png

The procedure described here was tested with a virtual machine such as the MVM. The USB controller of the MVM should be enabled by default. If you are using Linux-based distribution and are having trouble detecting a USB device in virtual machine, please make sure your user belongs to the vboxusers group.


This article shows how to create a bootable microSD for the DESK-MX6-L Release Notes kit by using a simple bash script.
Note: Starting from DESK-MX6-L 1.0.0 release the support for the SPL has been introduced in U-Boot. Previous versions of this script will no longer produce a fully functional and bootable microSD card.

The procedure has been tested on a MVM released with DESK-MX6-L 4.0.0 release with

  • a 32 GB microSD card [1]
  • a USB SD card reader
  • the binary files delivered along with the DESK-MX6-L 4.0.0.

The resulting card is partitioned as depicted here below:

  • bootable partition (mmcblk0p1, vfat) containing:
    • binary images (U-Boot and kernel images)
  • root file system partition (mmcblk0p2, ext3)
    • root file system binaries and init scripts

The script - named mksd.sh - can be realized with the following code:

#!/bin/bash

if [[ -z $1 || -z $2 || -z $3 || -z $4 || -z $5 ]]
then
        echo "$0 Usage:"
        echo "  $0 <device> <u-boot.img> <SPL> <binaries directory> <rootfs tar.bz2>"
        echo "  Example: $0 /dev/sdc u-boot.img SPL binaries/ rootfs.tar.bz2"
        exit
fi

if [ "$(whoami)" != "root" ]
then
        echo "you must be root to run this script!"
        exit
fi

if ! [[ -b $1 ]]
then
        echo "$1 is not a valid block device!"
        exit
fi

if ! [[ -e $2 ]]
then
        echo "Incorrect u-boot.img location!"
        exit
fi

if ! [[ -e $3 ]]
then
        echo "Incorrect SPL location!"
        exit
fi

if ! [[ -d $4 ]]
then
        echo "Incorrect Binaries location!"
        exit
fi

if ! [[ -f $5 ]]
then
        echo "Incorrect rootfs location!"
        exit
fi

DRIVE=$1
if [[ "$DRIVE" == *"mmcblk"* ]]
then
        echo "You're using a mmc device, I need to fix partition names"
        PART="p"
else
        PART=""
fi
UBOOT=$2
SPL=$3
BINARIES=$4
RFS=$5

echo "All data on "$DRIVE" now will be destroyed! Continue? [y/n]"
read ans
if ! [ $ans == 'y' ]
then
        exit
fi

echo "[Partitioning $1...]"

dd if=/dev/zero of=$DRIVE bs=1024 count=1024

SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`

echo DISK SIZE - $SIZE bytes

CYLINDERS=`echo $SIZE/255/63/512 | bc`

# check if we're running an old (e.g. 2.20.x) or new (e.g. 2.24.x) sfdisk
sfdisk --help | grep -- -H

if [ "$?" -eq "0" ]
then
        {
                echo 40,1380,0x0c,*
                echo 1420,,83,-
        } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
else
{
    echo 16M,8176M,0x0c,*
    echo 8192M,,83,-
} | sfdisk $DRIVE
fi

partprobe


echo "[Making filesystems...]"
mkfs.vfat -F 32 -n BOOT "$DRIVE$PART"1 #> /dev/null
mkfs.ext3 -F -L ROOTFS "$DRIVE$PART"2 #> /dev/null

# wait for the VM to recognize the uSD
sleep 60

echo "[Copying files...]"

binaries_dir=${BINARIES%/}
mount "$DRIVE$PART"1 /mnt
cp -av --no-preserve=ownership $binaries_dir/* /mnt/
umount "$DRIVE$PART"1

echo "[Extracting rfs (this may take a while...)]"
mount "$DRIVE$PART"2 /mnt
tar jxf $RFS -C /mnt > /dev/null
chmod 755 /mnt
umount "$DRIVE$PART"2

echo "[Programming SPL]"
dd if=$SPL of=$DRIVE bs=512 seek=2 conv=fsync

echo "[Programming u-boot.img]"
dd if=$UBOOT of=$DRIVE bs=1k seek=69 conv=fsync

echo "[Done]"


Here is an example that shows how to use this script. We use here files delivered with DESK-MX6-L 4.0.0 release. Before invoking the script, the following files has to be renamed in order to make them compatible with the default U-Boot environment variables:

  • bootscript: boot.scr
  • splash image: splash_image.bmp
  • Linux kernel: desk-mx6-l-4.0.0_uImage
  • Device tree blob: desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb.

In the case of you don't have some file on MVM, please download it from mirror.dave.eu.

We will copy them into ~/desk-mx-l/desk directory. Needed binary files can be found on MVM in the following location:

dvdk@vagrant:~$ ll /tftpboot/desk-mx6-l/
total 11360
drwxr-xr-x 2 dvdk root    4096 Apr  3 17:57 ./
drwxr-xr-x 3 dvdk root    4096 Apr  4 07:16 ../
-rw-r--r-- 1 dvdk root   52247 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb
-rw-r--r-- 1 dvdk root   52560 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-sbcx-cb0013.dtb
-rw-r--r-- 1 dvdk root   52161 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-sbcx-cb0018.dtb
-rw-r--r-- 1 dvdk root   53231 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-sbcx-cb0050.dtb
-rw-r--r-- 1 dvdk root   52536 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-sbcx-cb0055.dtb
-rw-r--r-- 1 dvdk root   48736 Apr  3 17:38 desk-mx6-l-4.0.0_imx6dl-xelk-l.dtb
-rw-r--r-- 1 dvdk root   53524 Apr  3 17:38 desk-mx6-l-4.0.0_imx6q-sbcx-cb0012.dtb
-rw-r--r-- 1 dvdk root   53833 Apr  3 17:38 desk-mx6-l-4.0.0_imx6q-sbcx-cb0013.dtb
-rw-r--r-- 1 dvdk root   50177 Apr  3 17:38 desk-mx6-l-4.0.0_imx6q-xelk-l-2-0-0.dtb
-rw-r--r-- 1 dvdk root   50009 Apr  3 17:38 desk-mx6-l-4.0.0_imx6q-xelk-l.dtb
-rw-r--r-- 1 dvdk root   56320 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_SPL
-rw-r--r-- 1 dvdk root   56320 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_nand_SPL
-rw-r--r-- 1 dvdk root  576288 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_nand_u-boot.img
-rw-r--r-- 1 dvdk root   56320 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_spi_SPL
-rw-r--r-- 1 dvdk root  554004 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_spi_u-boot.img
-rw-r--r-- 1 dvdk root  576000 Apr  3 17:38 desk-mx6-l-4.0.0_mx6qdldesk_u-boot.img
-rw-r--r-- 1 dvdk root 8038640 Apr  3 17:38 desk-mx6-l-4.0.0_uImage
-rw-r--r-- 1 dvdk root 1152054 Apr  3 17:38 splash_image.bmp
dvdk@vagrant:~$ ll ~/desk-mx-l/desk-mx6-l-4.0.0_boot.scr 
-rw-rw-r-- 1 dvdk dvdk 1556 Apr  3 17:57 /home/dvdk/desk-mx-l/desk-mx6-l-4.0.0_boot.scr
dvdk@vagrant:~$ mkdir -p ~/desk-mx-l/desk/
dvdk@vagrant:~$ cp /tftpboot/desk-mx6-l/desk-mx6-l-4.0.0_uImage ~/desk-mx-l/desk/desk-mx6-l-4.0.0_uImage
dvdk@vagrant:~$ cp /tftpboot/desk-mx6-l/desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb ~/desk-mx-l/desk/desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb
dvdk@vagrant:~$ cp ~/desk-mx-l/desk-mx6-l-4.0.0_boot.scr ~/desk-mx-l/desk/boot.scr
dvdk@vagrant:~$ cp /tftpboot/desk-mx6-l/splash_image.bmp ~/desk-mx-l/desk/
dvdk@vagrant:~$ cp ~/desk-mx-l/rfs/desk-mx6-l-4.0.0_modules.tar.gz ~/desk-mx-l/desk/

You can now run the script, by passing the following parameters:

  • Device file of the microSD card (/dev/sdb in the example)
  • U-Boot image
  • SPL
  • Path of the directory containing the bootscript file, the splash image, the Linux kernel image and the device tree blob files
  • Archive of the target's root file system (compressed as .tar.bz2 file).
dvdk@vagrant:~/desk-mx-l$ umount /dev/sdb*
dvdk@vagrant:~/desk-mx-l$ sudo ./desk-mx6-l-4.0.0_mksd.sh /dev/sdb /tftpboot/desk-mx6-l/desk-mx6-l-4.0.0_mx6qdldesk_u-boot.img /tftpboot/desk-mx6-l/desk-mx6-l-4.0.0_mx6qdldesk_SPL ~/desk-mx-l/desk ./rfs/desk-image-qt6-desk-mx6.tar.bz2 
All data on /dev/sdb now will be destroyed! Continue? [y/n]
y
[Partitioning /dev/sdb...]
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.228364 s, 4.6 MB/s
DISK SIZE - 31914983424 bytes
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 29.74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Transcend       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS disklabel with disk identifier 0xeba9791f.
/dev/sdb1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 8 GiB.
/dev/sdb2: Created a new partition 2 of type 'Linux' and of size 21.7 GiB.
/dev/sdb3: Done.

New situation:
Disklabel type: dos
Disk identifier: 0xeba9791f

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdb1  *       32768 16777215 16744448    8G  c W95 FAT32 (LBA)
/dev/sdb2       16777216 62333951 45556736 21.7G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[Making filesystems...]
mkfs.fat 4.1 (2017-01-24)
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 5694592 4k blocks and 1425408 inodes
Filesystem UUID: 2b7edb0e-b75b-4685-87b9-1933bfd0c8f0
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

[Copying files...]
'/home/dvdk/desk-mx-l/desk/boot.scr' -> '/mnt/boot.scr'
'/home/dvdk/desk-mx-l/desk/desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb' -> '/mnt/desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb'
'/home/dvdk/desk-mx-l/desk/desk-mx6-l-4.0.0_uImage' -> '/mnt/desk-mx6-l-4.0.0_uImage'
'/home/dvdk/desk-mx-l/desk/splash_image.bmp' -> '/mnt/splash_image.bmp'
[Extracting rfs (this may take a while...)]
[Programming SPL]
110+0 records in
110+0 records out
56320 bytes (56 kB, 55 KiB) copied, 0.0340295 s, 1.7 MB/s
[Programming u-boot.img]
562+1 records in
562+1 records out
576000 bytes (576 kB, 562 KiB) copied, 0.201931 s, 2.9 MB/s
[Done]

[1] In case you have a different size, you'll need to change the sfdisk parameters accordingly.

bootscr[edit | edit source]

Once you got the new binaries compiled from your modified sources, they have to be installed on first SD partition preserving the original file names used into boot.scr u-boot bootscript.

Here below there is an example on how to create a boot.scr file from the bootscript.txt for booting from SD card:

echo 'bootscript generated with command "mkimage -A ARM -T script -C none -n DESK-MX6 -d bootscript.txt boot.scr"'

setenv desk_release 'desk-mx6-l-4.0.0'

if test 0x${cb_configid#} = 0x00000002;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-sbcx.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-sbcx.dtb
	fi
elif test 0x${cb_configid#} = 0x00000003;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0003.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-sbcx-cb0003.dtb
	fi
elif test 0x${cb_configid#} = 0x00000012;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0012.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-sbcx-cb0012.dtb
	fi
elif test 0x${cb_configid#} = 0x00000013;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0013.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-sbcx-cb0013.dtb
	fi
elif test 0x${cb_configid#} = 0x00000077;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0077.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-sbcx-cb0077.dtb
	fi
elif test 0x${cb_configid#} = 0x00000001;
then
	if test ${cpu} = 6DL; then
		setenv fdtfile ${desk_release}_imx6dl-xelk-l.dtb
	else
		setenv fdtfile ${desk_release}_imx6q-xelk-l.dtb
	fi
elif test 0x${cb_configid#} = 0xffffffff;
then
	setenv fdtfile ${desk_release}_imx6q-xelk-l-2-0-0.dtb
else
    echo Invalid CB! Autoreset ...
    sleep 30
	reset
fi

setenv bootfile uImage

setenv mmc_loadk 'fatload mmc ${mmcdev}:1 ${loadaddr} ${bootfile}'
setenv mmc_loadfdt 'fatload mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}'

echo Booting DESK-MX6 via mmcboot with ${fdtfile} as device tree

run mmcboot

echo mmcboot FAILURE

and compile it using:

mkimage -A ARM -T script -C none -n DESK-MX6-L -d bootscript.txt boot.scr

Then copy the boot.scr into the <binaries_dir> directories used by the script to create the SD card.

Install Module[edit | edit source]

To install kernel modules, follow the steps below.

root@desk-mx6:~# sudo mount /dev/mmcblk0p1 /media                     
root@desk-mx6:~# tar xvzf /media/desk-mx6-l-4.0.0_modules.tar.gz -C /

After installation, run the following command to verify that the installation was successful:

root@desk-mx6:~# ls -l /lib/modules/$(uname -r)
total 304
lrwxrwxrwx 1 541 502     63 Apr  3  2023 build -> /home/jenkins/workspace/workspace/DESK-MX6-L-4.x.x_Linux-kernel
drwxr-xr-x 6 541 502   4096 Apr  3  2023 kernel
-rw-r--r-- 1 541 502   2812 Apr  3  2023 modules.alias
-rw-r--r-- 1 541 502   4926 Apr  3  2023 modules.alias.bin
-rw-r--r-- 1 541 502  15368 Apr  3  2023 modules.builtin
-rw-r--r-- 1 541 502  35496 Apr  3  2023 modules.builtin.alias.bin
-rw-r--r-- 1 541 502  17986 Apr  3  2023 modules.builtin.bin
-rw-r--r-- 1 541 502 107589 Apr  3  2023 modules.builtin.modinfo
-rw-r--r-- 1 541 502  10767 Apr  3  2023 modules.dep
-rw-r--r-- 1 541 502  21773 Apr  3  2023 modules.dep.bin
-rw-r--r-- 1 541 502      0 Apr  3  2023 modules.devname
-rw-r--r-- 1 541 502   8733 Apr  3  2023 modules.order
-rw-r--r-- 1 541 502     85 Apr  3  2023 modules.softdep
-rw-r--r-- 1 541 502  16970 Apr  3  2023 modules.symbols
-rw-r--r-- 1 541 502  23964 Apr  3  2023 modules.symbols.bin
lrwxrwxrwx 1 541 502     63 Apr  3  2023 source -> /home/jenkins/workspace/workspace/DESK-MX6-L-4.x.x_Linux-kernel


Attention ![edit | edit source]

  • /home/dvdk/desk-mx-l/desk-mx6-l-4.0.0_boot.scr has been generated using the images available at the moment of VM creation: please, use the previous indication as an example on how to create a proper bootscript for your own purposes
  • /home/dvdk/desk-mx-l/desk-mx6-l-4.0.0_mksd.sh bash script has been validated using a single SD card version: the size of the partitions and the related sfdisk parameters have to be properly modified according to your own SD card used and to your partitions specification. You can use it an an example to be modified according your use case


Hello word example[edit | edit source]

Here below an example on C code displaying the classic Hello World! message on the target serial console.

This example shows how to use the arm cross-compiler using the environment configured for this purpose

Setting the cross-compiler[edit | edit source]

It is assumed that the development environment has been set up properly as described here.

  • start the Linux development VM and login into the system
  • open a terminal window and cd into your source code directory
dvdk@vagrant:~$ mkdir myproject
dvdk@vagrant:~$ cd myproject/
dvdk@vagrant:~/myproject$ vi hello.c
dvdk@vagrant:~/myproject$ cat hello.c
#include <stdio.h>

int main(){
	printf("Hello, World!\n");
	return 0;
}
  • configure the build environment
dvdk@vagrant:~/myproject$ source ~/desk-mx-l/desk-mx6-l-4.0.0_env.sh 
  • as you can see here below, the $CC environment variable has been properly configured for using the SDK sysroot parameter:
dvdk@vagrant:~/myproject$ echo $CC
arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/dvdk/desk-mx-l/sdk/desk-mx6-l-4.0.0-toolchain/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi
dvdk@vagrant:~/myproject$ 
  • invoke the cross-compiler for compiling your source code example: the object file obtained, is a proper ELF 32-bit for the target microprocessor
dvdk@vagrant:~/myproject$ $CC hello.c -o hello
dvdk@vagrant:~/myproject$ file hello
hello: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=cca65e0cfb17eb97c0aca03d1222d4db656bda9f, for GNU/Linux 3.2.0, with debug_info, not stripped
dvdk@vagrant:~/myproject$ 

Running the example on the target[edit | edit source]

Now it is enough to copy the object file in the /home/root rfs directory and boot from nfs...

dvdk@vagrant:~/myproject$ sudo cp hello /home/dvdk/desk-mx-l/rfs/desk-mx6-l/home/root/
dvdk@vagrant:~/myproject$ sudo ls -la /home/dvdk/desk-mx-l/rfs/desk-mx6-l/home/root
total 28
drwx------ 3 root root  4096 Apr  7 16:02 .
drwxr-xr-x 4 root root  4096 Mar  9  2018 ..
-rwxr-xr-x 1 root root 12180 Apr  7 16:02 hello
drwxr-xr-x 6 root root  4096 Mar  9  2018 .nxp-demo-experience
-rw-r--r-- 1 root root  1011 Mar  9  2018 .profile
dvdk@vagrant:~/myproject$ 

on the target:

...
...
...
[  OK  ] Started Xinetd A Powerful Replacement For Inetd.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[  OK  ] Started Target Communication Framework agent.
[  OK  ] Reached target Multi-User System.
         Starting Record Runlevel Change in UTMP...
[  OK  ] Finished Record Runlevel Change in UTMP.

NXP i.MX Release Distro 5.15-kirkstone desk-mx6 ttymxc2

desk-mx6 login: root
root@desk-mx6:~# ls -la
total 24
drwx------ 2 root root  4096 Apr 28 22:23 .
drwxr-xr-x 3 root root  4096 Mar  9  2018 ..
-rw------- 1 root root   475 Apr 28 18:01 .bash_history
-rwxr-xr-x 1 root root 12180 Apr 28 22:23 hello
root@desk-mx6:~# ./hello
Hello, World!
root@desk-mx6:~#



Deployment[edit | edit source]

Booting from NAND flash[edit | edit source]

With respect to the NOR flash memories, NAND devices are known to be quite challenging with regard to the reliability. This is especially true when the NAND flash is used as the boot device. Several techniques such as wear leveling and bad block management have to be implemented to achieve an acceptable reliability.

This document provides information about the NAND device management, in order to handle it properly when it is used as the boot device on NXP i.MX6-based products.

Even though the example shown here refers to an i.MX6 DualLite board, the approach is substantially the same across all the i.MX6 family.

The test bed used in this example consists of an i.MX6 DualLite board equipped with a 512MB 8-bit asynchronous 1-bit ECC SLC NAND memory which is connected to the EIM bus of the SoC. The boot firmware image are the U-Boot binary files (desk-mx6-l-4.0.0_mx6qdldesk_nand_SPL and desk-mx6-l-4.0.0_mx6qdldesk_nand_u-boot.img). Their sizes are about 60kB (SPL) and 612 kB (u-boot).

From the point of view of MTD partitions, the boot partition for SPL is mtd0 is 2MB while the second stage partition mtd1 is 6MB.

Boot partition organization[edit | edit source]

The following image shows the organization of the boot partition.


Organization of the boot partition


The bootrom plays a major role in the boot process of any i.MX6 SoC. In case the NAND memory is the boot devices, this implies that the boot partition must be organized in order fulfill the bootrom requirements. Specifically, it contains:

  • A 1MB area (named Flash Control Block, FCB) which, in turn, includes
    • A data structure called NAND Control Block (NCB)
    • Three addresses which indicate where are located
      • The Discovered Bad Block Table (DBBT) which is the data structure used to manage the bad blocks of the NAND flash
      • The first copy of the firmware to load
      • The second (redundant) copy of the firmware to load
  • The DBBT
  • The first copy of the firmware
  • The second copy of the firmware.

For more details about the bootrom and the NAND boot process, please refer to the System Boot chapter of the Reference Manual of the specific i.MX6 Application Processor.

The following section will describe how to burn the boot partition in practice.

How to burn the boot partition[edit | edit source]

The burning of the boot partition is performed by the kobs-ng tool and the standard flash_erase and nandwrite flash utilities.

When the NAND flash is not burned yet, the product is usually configured in order to boot from a different device such as an SD card or through serial download mode.

Once the Linux kernel is up and running, the kobs-ng can be run as shown in the following example:

root@desk-mx6:~# kobs-ng -x -v -w desk-mx6-l-4.0.0_mx6qdldesk_nand_SPL
MTD CONFIG:
  chip_0_device_path = "/dev/mtd0"
  chip_1_device_path = "(null)"
  search_exponent = 2
  data_setup_time = 80
  data_hold_time = 60
  address_setup_time = 25
  data_sample_time = 6
  row_address_size = 3
  column_address_size = 2
  read_command_code1 = 0
  read_command_code2 = 48
  boot_stream_major_version = 1
  boot_stream_minor_version = 0
  boot_stream_sub_version = 0
  ncb_version = 3
  boot_stream_1_address = 0
  boot_stream_2_address = 0
  secondary_boot_stream_off_in_MB = 64
         -- We add the 1k-padding to the uboot.
.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'
.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'
mtd: use new bch layout raw access mode
mtd: opening: "/dev/mtd0"
NFC geometry :
        ECC Strength       : 2
        Page Size in Bytes : 2071
        Metadata size      : 10
        ECC Chunk Size in byte : 512
        ECC Chunk count        : 4
        Block Mark Byte Offset : 2028
        Block Mark Bit Offset  : 2
====================================================
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 524288
mtd: boot_stream_size_in_bytes = 57344
mtd: boot_stream_size_in_pages = 28
mtd: #1 0x00100000 - 0x00180000 (0x0010e000)
mtd: #2 0x00180000 - 0x00200000 (0x0018e000)
FCB
  m_u32Checksum = 0x00000000
  m_u32FingerPrint = 0x20424346
  m_u32Version = 0x01000000
  m_NANDTiming.m_u8DataSetup = 80
  m_NANDTiming.m_u8DataHold = 60
  m_NANDTiming.m_u8AddressSetup = 25
  m_NANDTiming.m_u8DSAMPLE_TIME = 6
  m_u32PageDataSize = 2048
  m_u32TotalPageSize = 2112
  m_u32SectorsPerBlock = 64
  m_u32NumberOfNANDs = 0
  m_u32TotalInternalDie = 0
  m_u32CellType = 0
  m_u32EccBlockNEccType = 1
  m_u32EccBlock0Size = 512
  m_u32EccBlockNSize = 512
  m_u32EccBlock0EccType = 1
  m_u32MetadataBytes = 10
  m_u32NumEccBlocksPerPage = 3
  m_u32EccBlockNEccLevelSDK = 0
  m_u32EccBlock0SizeSDK = 0
  m_u32EccBlockNSizeSDK = 0
  m_u32EccBlock0EccLevelSDK = 0
  m_u32NumEccBlocksPerPageSDK = 0
  m_u32MetadataBytesSDK = 0
  m_u32EraseThreshold = 0
  m_u32Firmware1_startingPage = 512
  m_u32Firmware2_startingPage = 768
  m_u32PagesInFirmware1 = 28
  m_u32PagesInFirmware2 = 28
  m_u32DBBTSearchAreaStartAddress = 256
  m_u32BadBlockMarkerByte = 2028
  m_u32BadBlockMarkerStartBit = 2
  m_u32BBMarkerPhysicalOffset = 2048
  m_u32BCHType = 0
  m_NANDTMTiming.m_u32TMTiming2_ReadLatency = 0
  m_NANDTMTiming.m_u32TMTiming2_PreambleDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_CEDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_PostambleDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_CmdAddPause = 0
  m_NANDTMTiming.m_u32TMTiming2_DataPause = 0
  m_NANDTMTiming.m_u32TMSpeed = 0
  m_NANDTMTiming.m_u32TMTiming1_BusyTimeout = 0
  m_u32DISBBM = 0
  m_u32BBMarkerPhysicalOffsetInSpareData = 0
DBBT
  m_u32Checksum = 0x00000000
  m_u32FingerPrint = 0x54424244
  m_u32Version = 0x01000000
  m_u32DBBTNumOfPages = 0
Firmware: image #0 @ 0x100000 size 0xe000 - available 0x80000
Firmware: image #1 @ 0x180000 size 0xe000 - available 0x80000
-------------- Start to write the [ FCB ] -----
mtd: erasing @0:0x0-0x20000
mtd: Writing FCB0 [ @0:0x0 ] (840) *
mtd: erasing @0:0x20000-0x40000
mtd: Writing FCB1 [ @0:0x20000 ] (840) *
mtd: erasing @0:0x40000-0x60000
mtd: Writing FCB2 [ @0:0x40000 ] (840) *
mtd: erasing @0:0x60000-0x80000
mtd: Writing FCB3 [ @0:0x60000 ] (840) *
mtd_commit_bcb(FCB): status 0

-------------- Start to write the [ DBBT ] -----
mtd: erasing @0:0x80000-0xa0000
mtd: Writing DBBT0 [ @0:0x80000 ] (800) *
mtd: erasing @0:0xa0000-0xc0000
mtd: Writing DBBT1 [ @0:0xa0000 ] (800) *
mtd: erasing @0:0xc0000-0xe0000
mtd: Writing DBBT2 [ @0:0xc0000 ] (800) *
mtd: erasing @0:0xe0000-0x100000
mtd: Writing DBBT3 [ @0:0xe0000 ] (800) *
mtd_commit_bcb(DBBT): status 0

---------- Start to write the [ .tmp_kobs_ng ]----
mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x0010e000
mtd: erasing @0:0x100000-0x120000
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ng: #1 @0: 0x00180000 - 0x0018e000
mtd: erasing @0:0x180000-0x1a0000
mtd: We write one page for save guard. *

then the second mtd1 partition can be written using nandwrite:

root@desk-mx6:~# flash_erase /dev/mtd1 0 0
Erasing 128 Kibyte @ 5e0000 -- 100 % complete 
root@desk-mx6:~# nandwrite -p /dev/mtd1 desk-mx6-l-4.0.0_mx6qdldesk_nand_u-boot.img 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000

In this case, the SPL boot partition–/dev/mtd0, indicated as a parameter of the command line– is 2MB. The u-boot.img partition–/dev/mtd1 - used for the second stage binary image is 6MB

It is possible to see those partition on U-Boot:

=> printenv mtdparts
mtdparts=mtdparts=gpmi-nand:2M(nand-SPL),6M(nand-uboot),1M(nand-env1),1M(nand-env2),1M(nand-fdt),1M(nand-spare),8M(nand-kernel),4M(nand-splash),-(nand-ubi)

or on Linux userspace:

root@desk-mx6:~# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00200000 00020000 "nand-SPL"
mtd1: 00600000 00020000 "nand-uboot"
mtd2: 00100000 00020000 "nand-env1"
mtd3: 00100000 00020000 "nand-env2"
mtd4: 00100000 00020000 "nand-fdt"
mtd5: 00100000 00020000 "nand-spare"
mtd6: 00800000 00020000 "nand-kernel"
mtd7: 00400000 00020000 "nand-splash"
mtd8: 3e800000 00020000 "nand-ubi"


Customizing the splash screen[edit | edit source]

Resources[edit | edit source]

For further details on splash screen support in U-Boot, please refer to:

Environment variables[edit | edit source]

The following environment variables are used by U-Boot for loading a BMP image from the selected storage and displayed in the screen (read from framebuffer memory):

  • splashimage: RAM address where the BMP image is loaded. Please note that it must be a 32-bit aligned address with a 0x2 offset (eg: 0x20000002)
  • splashpos: image position (eg: splashpos=m,m, for centering the image)
  • splashsize: image size in bytes (default value 0x400000)

The following environment variables are used for reading the splash image from the network:

  • splashfile: the splash image filename (default value is splash_image.bmp) to be read from the network
  • loadsplashfile loads the splash file from tftp in order to store the image in the internal storage device

Then, the following command is used for reading the image from the used storage device:

  • loadsplash: command for loading the BMP image from the storage device (e.g flash memory) to RAM. This command is automatically run by U-Boot when it executes bootcmd

Splash image in NOR SPI flash[edit | edit source]

The following command is used to store in NOR SPI flash a BMP image loaded via tftp:

spi_updatesplash=sf probe; sf erase 0xA00000 +${filesize}; sf write ${loadaddr} 0xA00000 ${filesize}

so, it is possibile to read a splash image from tftp and store it in NOR SPI:

run loadsplashfile
run spi_updatesplash

Splash image in NAND flash[edit | edit source]

The following command is used to store in NAND flash a BMP image loaded via tftp (please note that the NAND mtd partition for the splash image (nand-splash) is defined using the mtdparts parameter, and then referenced by the nand {erase,read,write} commands):

nand_updatesplash=nand erase.part nand-splash; nand write ${loadaddr} nand-splash ${filesize}

so, it is possibile to read a splash image from tftp and store it in NAND:

run loadsplashfile
run nand_updatesplash

Splash image in SD/eMMC[edit | edit source]

If an SD card or a eMMC device is used as boot device, the splashscreen image is directly loaded from the storage device.

In this example, the first partition - FAT format - is used directly reading the ${splashimage} BMP file.

mmc_loadsplash=fatload mmc ${mmcdev}:1 ${loadaddr} ${splashfile}; cp.b ${loadaddr} ${splashimage} ${filesize}

so, it is possibile to read directly a splash image from the eMMC partition:

loadsplash=run mmc_loadsplash


Standalone boot[edit | edit source]

Introduction[edit | edit source]

This document was written and tested with the software/hardware combination described in the history table above. However, it contains general concepts that can be adapted on any DAVE Embedded Systems' Linux platform.


200px-Emblem-important.svg.png

The following programming examples are intended for laboratory usage or for preliminary deployment strategy.

A complete deployment strategy has to be carefully identifiyed taking into account the overall arguments like: boot speed, safe boot, recovery mechanisms, watchdog supervisor, etc.


We'll explain how to program and configure a <SOM> to boot in standalone mode, without the need of a system microSD card or an NFS server, with three options:

  • booting with NOR and NAND internal storage
    • in this configuration the primary boot images will be fetched from NOR flash storage, while the root file system will be fetched from NAND flash
  • booting with NAND only
    • in this configuration the whole system will boot without the need of a NOR flash storage, all images and the root file system will be fetched from NAND flash
  • booting with eMMC only
    • in this configuration the whole system will boot without the need of a NOR/NAND flashes storage, all images and the root file system will be fetched from eMMC flash

Program boot images into NOR flash[edit | edit source]

It is supposed that the proper filenames are configured on U-Boot variables. Those files should be available on TFTP server. In the following examples, we use the boot images:

spl=desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_spi_SPL
ubootimg=desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_spi_u-boot.img
bootfile=desk-mx-l/desk-mx6-l-4.0.0_uImage
fdtfile=desk-mx-l/desk-mx6-l-4.0.0_imx6q-sbcx-cb0012.dtb

We assume that the following environment variables are present in U-Boot too:

load_spl=tftp ${loadaddr} ${spl}
load_uboot=tftp ${loaddr} ${ubootimg}
spi_update_spl=sf probe; sf erase 0 10000;sf write ${loadaddr} 400 ${filesize}
spi_update_uboot=sf probe; sf erase 10000 f0000;sf write ${loadaddr} 10000 ${filesize}

U-Boot[edit | edit source]

Update to the latest U-Boot version allows usage of U-Boot environment variables available.

=> run load_spl
Using FEC device
TFTP from server 192.168.0.125; our IP address is 192.168.0.90
Filename 'desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_spi_SPL'.
Load address: 0x12000000
Loading: ############
         560.5 KiB/s
done
Bytes transferred = 56320 (dc00 hex)
=> run spi_update_spl
SF: Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiB
SF: 65536 bytes @ 0x0 Erased: OK
device 0 offset 0x400, size 0xdc00
SF: 56320 bytes @ 0x400 Written: OK
=> run load_uboot
Using FEC device
TFTP from server 192.168.0.125; our IP address is 192.168.0.90
Filename 'desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_spi_u-boot.img'.
Load address: 0x12000000
Loading: #################################################################
         ###############################################
         1009.8 KiB/s
done
Bytes transferred = 569864 (8b208 hex)
=> run spi_update_uboot
SF: Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiB
SF: 983040 bytes @ 0x10000 Erased: OK
device 0 offset 0x10000, size 0x8b208
SF: 569864 bytes @ 0x10000 Written: OK
=>

kernel image and device tree[edit | edit source]

We assume that the following environment variables are present in U-Boot:

loadk=tftpboot ${loadaddr} ${serverip}:${bootfile}
loadfdt=tftpboot ${fdtaddr} ${serverip}:${fdtfile}
spi_updatek=sf erase 200000 800000; sf write ${loadaddr} 200000 ${filesize}
spi_updatefdt=sf erase 180000 80000; sf write ${fdtaddr} 180000 ${filesize}
spi_loadk=sf read ${loadaddr} 200000 800000
spi_loadfdt=sf read ${fdtaddr} 180000 80000
spi_nand=sf probe; run spi_loadk spi_loadfdt nandargs addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
  • Update the bootfile and fdtfile environment variables to fit the filename as found inside the TFTP server.
  • Program kernel and device tree on NOR flash with the following U-Boot command
sf probe; run loadk spi_updatek loadfdt spi_updatefdt

E.g.:

=> sf probe; run loadk spi_updatek loadfdt spi_updatefdt
SF: Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiB
Using FEC device
TFTP from server 192.168.0.125; our IP address is 192.168.0.90
Filename 'desk-mx-l/desk-mx6-l-4.0.0_uImage'.
Load address: 0x12000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########
         1.2 MiB/s
done
Bytes transferred = 7031520 (6b4ae0 hex)
SF: 8388608 bytes @ 0x200000 Erased: OK
device 0 offset 0x200000, size 0x6b4ae0
SF: 7031520 bytes @ 0x200000 Written: OK
Using FEC device
TFTP from server 192.168.0.125; our IP address is 192.168.0.90
Filename 'desk-mx-l/desk-mx6-l-4.0.0_imx6q-sbcx-cb0012.dtb'.
Load address: 0x18000000
Loading: ###########
         564.5 KiB/s
done
Bytes transferred = 53760 (d200 hex)
SF: 524288 bytes @ 0x180000 Erased: OK
device 0 offset 0x180000, size 0xd200
SF: 53760 bytes @ 0x180000 Written: OK
=>

Reboot the system and configure U-Boot to apply the new configuration

=> setenv bootcmd run spi_nand
=> saveenv

Program boot images into NAND flash[edit | edit source]

U-Boot[edit | edit source]

U-Boot SPL on NAND flash must be programmed using NXP kobs-ng utility and the second stage using the nandwrite: this tool is required for writing the correct U-Boot image on NAND storing all information needed by bootrom to identify the NAND as a boot device.

Here below an example:

  • boot the system via SD on NFS
  • uses a rfs with kobs-ng utility available on it (e.g. DAVE's rfs provided with DESK-MX6-L)
  • copy the related U-Boot imx image file on nfs /home/root (for example)
  • execute kobs-ng passing the parameters for flashing U-Boot on NAND
  • erase and program the second stage using flash_erase and nandwrite
root@desk-mx6:~# kobs-ng -x -v -w desk-mx6-l-4.0.0_mx6qdldesk_nand_SPL
MTD CONFIG:
  chip_0_device_path = "/dev/mtd0"
  chip_1_device_path = "(null)"
  search_exponent = 2
  data_setup_time = 80
  data_hold_time = 60
  address_setup_time = 25
  data_sample_time = 6
  row_address_size = 3
  column_address_size = 2
  read_command_code1 = 0
  read_command_code2 = 48
  boot_stream_major_version = 1
  boot_stream_minor_version = 0
  boot_stream_sub_version = 0
  ncb_version = 3
  boot_stream_1_address = 0
  boot_stream_2_address = 0
  secondary_boot_stream_off_in_MB = 64
         -- We add the 1k-padding to the uboot.
.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'
.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'
mtd: use new bch layout raw access mode
mtd: opening: "/dev/mtd0"
NFC geometry :
        ECC Strength       : 2
        Page Size in Bytes : 2071
        Metadata size      : 10
        ECC Chunk Size in byte : 512
        ECC Chunk count        : 4
        Block Mark Byte Offset : 2028
        Block Mark Bit Offset  : 2
====================================================
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 524288
mtd: boot_stream_size_in_bytes = 57344
mtd: boot_stream_size_in_pages = 28
mtd: #1 0x00100000 - 0x00180000 (0x0010e000)
mtd: #2 0x00180000 - 0x00200000 (0x0018e000)
FCB
  m_u32Checksum = 0x00000000
  m_u32FingerPrint = 0x20424346
  m_u32Version = 0x01000000
  m_NANDTiming.m_u8DataSetup = 80
  m_NANDTiming.m_u8DataHold = 60
  m_NANDTiming.m_u8AddressSetup = 25
  m_NANDTiming.m_u8DSAMPLE_TIME = 6
  m_u32PageDataSize = 2048
  m_u32TotalPageSize = 2112
  m_u32SectorsPerBlock = 64
  m_u32NumberOfNANDs = 0
  m_u32TotalInternalDie = 0
  m_u32CellType = 0
  m_u32EccBlockNEccType = 1
  m_u32EccBlock0Size = 512
  m_u32EccBlockNSize = 512
  m_u32EccBlock0EccType = 1
  m_u32MetadataBytes = 10
  m_u32NumEccBlocksPerPage = 3
  m_u32EccBlockNEccLevelSDK = 0
  m_u32EccBlock0SizeSDK = 0
  m_u32EccBlockNSizeSDK = 0
  m_u32EccBlock0EccLevelSDK = 0
  m_u32NumEccBlocksPerPageSDK = 0
  m_u32MetadataBytesSDK = 0
  m_u32EraseThreshold = 0
  m_u32Firmware1_startingPage = 512
  m_u32Firmware2_startingPage = 768
  m_u32PagesInFirmware1 = 28
  m_u32PagesInFirmware2 = 28
  m_u32DBBTSearchAreaStartAddress = 256
  m_u32BadBlockMarkerByte = 2028
  m_u32BadBlockMarkerStartBit = 2
  m_u32BBMarkerPhysicalOffset = 2048
  m_u32BCHType = 0
  m_NANDTMTiming.m_u32TMTiming2_ReadLatency = 0
  m_NANDTMTiming.m_u32TMTiming2_PreambleDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_CEDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_PostambleDelay = 0
  m_NANDTMTiming.m_u32TMTiming2_CmdAddPause = 0
  m_NANDTMTiming.m_u32TMTiming2_DataPause = 0
  m_NANDTMTiming.m_u32TMSpeed = 0
  m_NANDTMTiming.m_u32TMTiming1_BusyTimeout = 0
  m_u32DISBBM = 0
  m_u32BBMarkerPhysicalOffsetInSpareData = 0
DBBT
  m_u32Checksum = 0x00000000
  m_u32FingerPrint = 0x54424244
  m_u32Version = 0x01000000
  m_u32DBBTNumOfPages = 0
Firmware: image #0 @ 0x100000 size 0xe000 - available 0x80000
Firmware: image #1 @ 0x180000 size 0xe000 - available 0x80000
-------------- Start to write the [ FCB ] -----
mtd: erasing @0:0x0-0x20000
mtd: Writing FCB0 [ @0:0x0 ] (840) *
mtd: erasing @0:0x20000-0x40000
mtd: Writing FCB1 [ @0:0x20000 ] (840) *
mtd: erasing @0:0x40000-0x60000
mtd: Writing FCB2 [ @0:0x40000 ] (840) *
mtd: erasing @0:0x60000-0x80000
mtd: Writing FCB3 [ @0:0x60000 ] (840) *
mtd_commit_bcb(FCB): status 0

-------------- Start to write the [ DBBT ] -----
mtd: erasing @0:0x80000-0xa0000
mtd: Writing DBBT0 [ @0:0x80000 ] (800) *
mtd: erasing @0:0xa0000-0xc0000
mtd: Writing DBBT1 [ @0:0xa0000 ] (800) *
mtd: erasing @0:0xc0000-0xe0000
mtd: Writing DBBT2 [ @0:0xc0000 ] (800) *
mtd: erasing @0:0xe0000-0x100000
mtd: Writing DBBT3 [ @0:0xe0000 ] (800) *
mtd_commit_bcb(DBBT): status 0

---------- Start to write the [ .tmp_kobs_ng ]----
mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x0010e000
mtd: erasing @0:0x100000-0x120000
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ng: #1 @0: 0x00180000 - 0x0018e000
mtd: erasing @0:0x180000-0x1a0000
mtd: We write one page for save guard. *
root@desk-mx6:~# flash_erase /dev/mtd1 0 0
Erasing 128 Kibyte @ 5e0000 -- 100 % complete 
root@desk-mx6:~# nandwrite -p /dev/mtd1 desk-mx6-l-4.0.0_mx6qdldesk_nand_u-boot.img 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000

kernel image and device tree[edit | edit source]

We assume that the following environment variables are present in U-Boot:

nand_updatek=nand erase.part nand-kernel; nand write ${loadaddr} nand-kernel ${filesize}
nand_updatefdt=nand erase.part nand-fdt; nand write ${fdtaddr} nand-fdt ${filesize}
nand_loadk=nand read ${loadaddr} nand-kernel
nand_loadfdt=nand read ${fdtaddr} nand-fdt
nand_nand=run nand_loadk nand_loadfdt nandargs addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
  • Update the bootfile and fdtfile environment variables to fit the filename as found inside the TFTP server.
  • Program kernel and device tree on NAND flash with the following U-Boot command
run loadk nand_updatek loadfdt nand_updatefdt

E.g.:

=> run loadk nand_updatek loadfdt nand_updatefdt
Using FEC device
TFTP from server 192.168.4.210; our IP address is 192.168.4.63
Filename 'desk-mx-l/desk-mx6-l-4.0.0_uImage'.
Load address: 0x12000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###########
         2 MiB/s
done
Bytes transferred = 8038640 (7aa8f0 hex)

NAND erase.part: device 0 offset 0xc00000, size 0x800000
Erasing at 0x13e0000 -- 100% complete.
OK

NAND write: device 0 offset 0xc00000, size 0x7aa8f0
 8038640 bytes written: OK
Using FEC device
TFTP from server 192.168.4.210; our IP address is 192.168.4.63
Filename 'desk-mx-l/desk-mx6-l-4.0.0_imx6dl-sbcx-cb0012.dtb'.
Load address: 0x18000000
Loading: ###########
         980.5 KiB/s
done
Bytes transferred = 52247 (cc17 hex)

NAND erase.part: device 0 offset 0xa00000, size 0x100000
Erasing at 0xae0000 -- 100% complete.
OK

NAND write: device 0 offset 0xa00000, size 0xcc17
 52247 bytes written: OK

Reboot the system and configure U-Boot to apply the new configuration

=> setenv bootcmd run nand_nand
=> saveenv

Program boot images into eMMC[edit | edit source]

U-Boot[edit | edit source]

Update to the latest U-Boot version allows usage of U-Boot environment variables available.

=> printenv mmc_update_spl 
mmc_update_spl=mmc dev; setexpr blocks ${filesize} / 0x200; setexpr blocks ${blocks} + 1; mmc write ${loadaddr} 2 ${blocks}
=> printenv mmc_update_uboot 
mmc_update_uboot=mmc dev; setexpr blocks ${filesize} / 0x200; setexpr blocks ${blocks} + 1; mmc write ${loadaddr} 0x8a  ${blocks}

Load U-Boot binary form a tftp server:

=> run load_spl 
Using FEC device
TFTP from server 192.168.4.240; our IP address is 192.168.4.49
Filename 'desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_SPL'.
Load address: 0x12000000
Loading: ############
         1.1 MiB/s
done
Bytes transferred = 60416 (ec00 hex)
=> run mmc_update_spl 
switch to partitions #0, OK
mmc0 is current device (SD)

MMC write: dev # 0, block # 2, count 119 ... 119 blocks written: OK
=> run load_uboot 
Using FEC device
TFTP from server 192.168.4.240; our IP address is 192.168.4.49
Filename 'desk-mx-l/desk-mx6-l-4.0.0_mx6qdldesk_u-boot.img'.
Load address: 0x12000000
Loading: #################################################################
         ##########################################################
         1.5 MiB/s
done
Bytes transferred = 624932 (98924 hex)
=> run mmc_update_uboot 
switch to partitions #0, OK
mmc0 is current device (SD)

MMC write: dev # 0, block # 138, count 1221 ... 1221 blocks written: OK

Load U-Boot binary from an SD card:

Hit ENTER within 1 seconds to stop autoboot
=> fatload mmc 0:1 ${loadaddr} desk-mx6-l-4.0.0_mx6qdldesk_SPL
56320 bytes read in 20 ms (2.7 MiB/s)
=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device (eMMC)
=> run mmc_update_spl
switch to partitions #0, OK
mmc2 is current device (eMMC)

MMC write: dev # 2, block # 2, count 111 ... 111 blocks written: OK
=> fatload mmc 0:1 ${loadaddr} desk-mx6-l-4.0.0_mx6qdldesk_u-boot.img
569864 bytes read in 45 ms (12.1 MiB/s)
=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device (eMMC)
=> run mmc_update_uboot
switch to partitions #0, OK
mmc2 is current device (eMMC)

MMC write: dev # 2, block # 138, count 1114 ... 1114 blocks written: OK
=>

kernel image and device tree[edit | edit source]

We assume that the following environment variables are present in U-Boot:

mmc_loadk=fatload mmc ${mmcdev}:1 ${loadaddr} ${bootfile}
mmc_loadfdt=fatload mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}
mmc_loadsplash=fatload mmc ${mmcdev}:1 ${loadaddr} ${splashfile}; cp.b ${loadaddr} ${splashimage} ${filesize}
mmcboot=run mmcargs addcons addmisc; if run mmc_loadk; then if run mmc_loadfdt; then bootm ${loadaddr} - ${fdtaddr}; fi; fi

Using an SD card or an eMMC device assumes that bootfile, fdtfile and splashfile are stored into fist MMC device partition.

Then, U-Boot uses the previous listed commands for reading the binary images and starting the linux bootstrap from the MMC part 2 (which is reserved for the root-file system storage).

The following U-Boot environment variables are present for this purposes:

mmcargs=setenv bootargs root=${mmcroot}
mmcroot=/dev/mmcblk2p2 rootwait rw

boot vars[edit | edit source]

The following environment variables should be configured for U-Boot properly reading the boot files from the first SD card partition, e.g.

=> setenv normalboot mmcboot
=> setenv bootfile desk-mx6-l-4.0.0_mx6qdldesk_uImage
=> setenv fdtfile desk-mx6-l-4.0.0_mx6qdldesk_imx6dl-sbcx-cb0012.dtb
=> setenv splashfile splash_image.bmp

then save the environment and reboot the system to apply the new configuration:

=> saveenv
Saving Environment to MMC...
Writing to MMC(2)... done
=> reset

Program root file system into NAND flash[edit | edit source]

  • Boot the system via SD or NFS as described in the Booting from nfs wiki page.
  • By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for U-Boot and kernel images. Here we won't modify this default configuration. The MTD partitions can be dumped with /proc/mtd (the partition's name should be self-explanatory)
root@imx6qdlxelk:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "nand-SPL"
mtd1: 00600000 00020000 "nand-uboot"
mtd2: 00100000 00020000 "nand-env1"
mtd3: 00100000 00020000 "nand-env2"
mtd4: 00100000 00020000 "nand-fdt"
mtd5: 00100000 00020000 "nand-spare"
mtd6: 00800000 00020000 "nand-kernel"
mtd7: 00400000 00020000 "nand-splash"
mtd8: 1e800000 00020000 "nand-ubi"
root@imx6qdlxelk:~#


200px-Emblem-important.svg.png

Please note that MTD partition index may change depending of flash device availability, flash device size, U-Boot environment variables or kernel device driver load order. Always take care of looking inside /proc/mtd to match your specific layout


  • Format and initialize nand-ubi partition, which in our case is mtd8, using UBI with:
ubiformat /dev/mtd8
ubiattach -m 8
ubimkvol /dev/ubi0 -N rootfs -m

E.g.

root@desk-mx6:~# ubiformat /dev/mtd8
ubiformat: mtd8 (nand), size 1048576000 bytes (1000.0 MiB), 8000 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 7999 -- 100 % complete  
ubiformat: 8000 eraseblocks have valid erase counter, mean value is 116
ubiformat: formatting eraseblock 7999 -- 100 % complete  
root@desk-mx6:~# ubiattach -m 8
[  201.648474] ubi0: attaching mtd8
[  203.638158] ubi0: scanning is finished
[  203.658702] ubi0: attached mtd8 (name "nand-ubi", size 1000 MiB)
[  203.664827] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[  203.672513] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[  203.679330] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[  203.687928] ubi0: good PEBs: 8000, bad PEBs: 0, corrupted PEBs: 0
[  203.694456] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  203.702103] ubi0: max/mean erase counter: 121/117, WL threshold: 4096, image sequence number: 493697587
[  203.711974] ubi0: available PEBs: 7836, total reserved PEBs: 164, PEBs reserved for bad PEB handling: 160
[  203.721987] ubi0: background thread "ubi_bgt0d" started, PID 635
UBI device number 0, total 8000 LEBs (1015808000 bytes, 968.7 MiB), available 7836 LEBs (994983936 bytes, 948.8 MiB), LEB size 126976 bytes (124.0 KiB)
root@desk-mx6:~# ubimkvol /dev/ubi0 -N rootfs -m
Set volume size to 994983936
Volume ID 0, size 7836 LEBs (994983936 bytes, 948.8 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
  • Now mount the UBI volume using UBIFS in a temporary directory
mkdir -p /mnt/nand
mount -t ubifs ubi0_0 /mnt/nand

E.g.:

root@desk-mx6:~# mkdir -p /mnt/nand
root@desk-mx6:~# mount -t ubifs ubi0_0 /mnt/nand
[  226.375941] UBIFS (ubi0:0): default file-system created
[  226.381545] UBIFS (ubi0:0): Mounting in unauthenticated mode
[  226.387403] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 641
[  226.421704] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[  226.429128] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[  226.440000] UBIFS (ubi0:0): FS size: 992698368 bytes (946 MiB, 7818 LEBs), max 7836 LEBs, journal size 33521664 bytes (31 MiB, 264 LEBs)
[  226.452510] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[  226.459239] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 2AC18D3A-E457-47E0-9BD1-78A7C3483B73, small LPT model
  • you can now extract the root file system into that directory
tar xvjf dave-image-devel-desk-mx6.tar.bz2 -C /mnt/nand
  • finally, you need to cleanly umount and detach the MTD partition
umount /mnt/nand/
ubidetach -m 8

E.g.

root@desk-mx6:~# umount /mnt/nand/
[  238.072434] UBIFS (ubi0:0): un-mount UBI device 0
[  238.077232] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops
root@desk-mx6:~# ubidetach -m 8
[  240.786549] ubi0: detaching mtd8
[  240.798612] ubi0: mtd8 is detached

You can now safely reboot or turn off the system.

In U-Boot environment check the following variable, which must contain the same MTD partition number used above

nand_args=setenv bootargs root=ubi0:rootfs rootfstype=ubifs rw ubi.mtd=8

Program root file system into eMMC flash[edit | edit source]

  • Boot the system via SD or NFS as described in the Booting from nfs wiki page
  • eMMC device has to be partitioned and properly formatted choosing the file system for each partition
  • an example of SD partitioning script is the following one:

FAT32 partition[edit | edit source]

#!/bin/sh

node=$1

# partition size in MB
BOOTLOAD_RESERVE=8
BOOT_ROM_SIZE=128
RFS_SIZE=2048

# create the SDCARD partition
part=""
echo ${node} | grep mmcblk > /dev/null
if [ "$?" -eq "0" ]; then
        part="p"
fi

# print the SD total capacity
total_size=`sfdisk -s ${node}`
total_size=`expr ${total_size} / 1024`
echo SD total size: ${total_size}KB

# calculate partition sizes
boot_start=`expr ${BOOTLOAD_RESERVE} \\* 1024 \\* 1024 / 512`
boot_size=`expr ${BOOT_ROM_SIZE} \\* 1024 \\* 1024 / 512`
rfs_start=`expr ${boot_size} + ${boot_start}`
rfs_size=`expr ${RFS_SIZE} \\* 1024 \\* 1024 / 512`

umount ${node}${part}1 > /dev/null 2>&1
umount ${node}${part}2 > /dev/null 2>&1

# call sfdisk to create partition table
{ echo ${boot_start},${boot_size},0c,-; echo ${rfs_start},${rfs_size},83,-; } | sfdisk --force ${node}

# format the SDCARD partition
echo "formatting boot"
mkfs.vfat -F 32 -n boot ${node}${part}1
echo "formatting rfs"
mkfs.ext4 -F ${node}${part}2 -Lrfs

E.g.

root@desk-mx6:~# ./sdcard-partition.sh /dev/mmcblk2
SD total size: 3776KB
[ 1341.905014]  mmcblk2: p1 p2
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk2: 3.7 GiB, 3959422976 bytes, 7733248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical):[ 1341.922729]  mmcblk2: p1 p2
 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa77eb3f0

Old situation:

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk2p1        2048  264191  262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk2p2      264192 4458495 4194304    2G 83 Linux

>>> Created a new DOS disklabel with disk identifier 0xcce0c36f.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 128 MiB.
/dev/mmcblk2p2: Created a new partition 2 of type 'Linux' and of size 2 GiB.
/dev/mmcblk2p3:
New situation:

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk2p1       16384  278527  262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk2p2      278528 4472831 4194304    2G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
formatting boot
mkfs.fat 3.0.28 (2015-05-16)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
formatting rfs
mke2fs 1.43-WIP (18-May-2015)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 9a685543-1af2-4e39-83f3-b8a32248c021
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
  • create a mount point and mount the first partition
mkdir -p /mnt/emmc
mount /dev/mmcblk2p1 /mnt/emmc
  • copy kernel, dtb and splash_image files
root@desk-mx6:~# mount /dev/mmcblk2p1 /mnt/emmc
[   40.988575] FAT-fs (mmcblk2p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@desk-mx6:~# cd /mnt/emmc
root@desk-mx6:/mnt/emmc# cp /tftpboot/desk-mx/linux/desk-mx-4.0.0*dtb .
root@desk-mx6:/mnt/emmc# cp /tftpboot/desk-mx/linux/desk-mx-4.0.0*uImage .
root@desk-mx6:/mnt/emmc# cp /tftpboot/desk-mx/linux/splash_image.bmp .
root@desk-mx6:/mnt/emmc# cd
root@desk-mx6:~# umount /mnt/emmc
  • now mount the EXT4 volume in the temporary directory

E.g.:

root@desk-mx6:~# mount /dev/mmcblk2p2 /mnt/emmc
[ 1810.899327] EXT4-fs (mmcblk2p2): mounted filesystem with ordered data mode. Opts: (null)
root@desk-mx6:~# cd /mnt/emmc
root@desk-mx6:/mnt/emmc# 
  • you can now extract the root file system into that directory
tar xvjf dave-image-devel-desk-mx6.tar.bz2 -C /mnt/emmc
  • finally, you need to cleanly umount and safely reboot or turn off the system.
root@desk-mx6:/mnt/emmc# cd
root@desk-mx6:~# umount /mnt/emmc
root@desk-mx6:~# reboot

Reboot the system and configure U-Boot to apply the new configuration

=> setenv bootcmd run mmcboot
=> saveenv

ext4 partition[edit | edit source]

For using an ext4 partition also for boot files, it is possibile to change the formatting script:

{ echo ${boot_start},${boot_size},83,-; echo ${rfs_start},${rfs_size},83,-; } | sfdisk --force ${node}

and formatting the first partition using mkfs.ext4

mkfs.ext4 -F ${node}${part}1 -Lboot

then, the U-Boot environment has to be properly configured:

=> setenv mmc_loadk 'ext4load mmc ${mmcdev}:1 ${loadaddr} ${bootfile}'
=> setenv mmc_loadfdt 'ext4load mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}'
=> setenv mmc_loadsplash 'ext4load mmc ${mmcdev}:1 ${loadaddr} ${splashfile}; cp.b ${loadaddr} ${splashimage} ${filesize}'
=> saveenv

U-Boot parameters for root file system device[edit | edit source]

Once booted, the kernel looks for a device where reading and starting the root file system. See more information in the man pages.

Here below some examples and configuration used in the DAVE's U-Boot environment:

rfs in NAND[edit | edit source]

The root file system can be programmed into an UBI formatted partition and, for example, the nandargs parameters can be used. The following rows show the standard DAVE's NAND partitioning:

...
...
[    3.859646] 9 cmdlinepart partitions found on MTD device gpmi-nand
[    3.865861] Creating 9 MTD partitions on "gpmi-nand":
[    3.870924] 0x000000000000-0x000000200000 : "nand-SPL"
[    3.885045] 0x000000200000-0x000000800000 : "nand-uboot"
[    3.895099] 0x000000800000-0x000000900000 : "nand-env1"
[    3.905059] 0x000000900000-0x000000a00000 : "nand-env2"
[    3.915071] 0x000000a00000-0x000000b00000 : "nand-fdt"
[    3.925049] 0x000000b00000-0x000000c00000 : "nand-spare"
[    3.935124] 0x000000c00000-0x000001400000 : "nand-kernel"
[    3.945057] 0x000001400000-0x000001800000 : "nand-splash"
[    3.955104] 0x000001800000-0x000040000000 : "nand-ubi"
...
...

and then the corresponding U-Boot parameter for using the /dev/mtd8 device:

nandargs=setenv bootargs ubi.mtd=8 root=ubi0_0 rootfstype=ubifs rw

In this configuration, the kernel attachs the UBI partition, mount the UBIFS file system and starts it:

...
...
[    5.559821] ubi0: attaching mtd8
[    7.990342] ubi0: scanning is finished
[    8.021500] ubi0: attached mtd8 (name "nand-ubi", size 1000 MiB)
[    8.027595] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    8.034504] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    8.041299] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    8.048291] ubi0: good PEBs: 8000, bad PEBs: 0, corrupted PEBs: 0
[    8.054414] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    8.061644] ubi0: max/mean erase counter: 63/52, WL threshold: 4096, image sequence number: 819217695
[    8.070886] ubi0: available PEBs: 0, total reserved PEBs: 8000, PEBs reserved for bad PEB handling: 160
[    8.080359] ubi0: background thread "ubi_bgt0d" started, PID 157
[    8.164282] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    8.170156] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 163
[    8.210063] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    8.217549] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    8.227505] UBIFS (ubi0:0): FS size: 992698368 bytes (946 MiB, 7818 LEBs), journal size 33521664 bytes (31 MiB, 264 LEBs)
[    8.238514] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[    8.245169] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID BEC33049-213B-4D02-A9CE-5F0D7EB5DAA8, small LPT model
[    8.257174] VFS: Mounted root (ubifs filesystem) on device 0:14.
...
...

rfs in SD card[edit | edit source]

The root file system can be programmed into an SD card partition and, for example, the mmcargs parameters can be used. The following row in an example to use an SD card with two partition:

...
...
[    5.061660] mmc0: new high speed SDHC card at address aaaa
[    5.071528] mmcblk0: mmc0:aaaa SC16G 14.8 GiB
[    5.071528] mmcblk0: mmc0:aaaa SC16G 14.8 GiB 
[    5.088454]  mmcblk0: p1 p2
...
...

and then the corresponding U-Boot parameters for using the /dev/mmcblk0p2 partition (which is typically the second ext4 formatted SD partition):

mmcargs=setenv bootargs root=${mmcroot}

mmcroot=/dev/mmcblk0p2 rootwait rw

In this configuration the kernel mounts the root file system correctly in this way:

...
...
[    5.681176] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    5.689678] VFS: Mounted root (ext3 filesystem) on device 179:2.
[    5.707149] devtmpfs: mounted
[    5.713124] Freeing unused kernel memory: 1024K
...
...


How to configure the network interfaces[edit | edit source]

For deploying an Embedded System, one of the most important configuration is the Network Interface configuration.

Once the Embedded Device is finally configured for stand-alone bootstrap, the network interface should be configured for reaching the device remotely via network connections like ssh, telnet, ftp, http, etc.

This Application Note briefly describes how it is possible to simply configure the network interfaces on systemd

Resources[edit | edit source]

For further details on network configuration, please refer - for example - to:

Examples[edit | edit source]

The following configuration assumptions are used in the paragraphs shown below:

  • IP address range of the LAN network 192.168.1.0 - 192.168.1.255
  • IP address of the gateway 192.168.1.254
  • IP address of the device 192.168.1.100

systemd[edit | edit source]

The network configuration for systemd are basically found in the /etc/systemd/network/ directory.

The most simply way for configuring the network interface is to create/edit the file /etc/systemd/network/20-eth0.network as per the following paragraphs.

For more example and usage hints on systemd, please refer to our wiki page.

Static IP address[edit | edit source]

[Match]
Name=eth0

# Prevent the interface loading if the kernel boots from nfs
KernelCommandLine=!nfsroot

[Network]
Address=192.168.1.100/24
Gateway=192.168.1.254
DNS=192.168.1.1

Dynamic IP addres (DHCP)[edit | edit source]

The network interface is configured - using a proper DHCP server on the network - by using the DHCP key in the configuration file as the following:

[Match]
Name=eth0

# Prevent the interface loading if the kernel boots from nfs
KernelCommandLine=!nfsroot

[Network]
DHCP=yes

When systemd network starts, it tries to use a DHCP server present in the network to configure the interface.

DNS[edit | edit source]

The DNS key (in the configuration file) is used only if the systemd-resolved service is enabled and the /etc/resolv.conf has a symbolic link to /run/systemd/resolve/stub-resolv.conf

ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

loopback network interface[edit | edit source]

systemd contains native implementations of various tasks that need to be executed as part of the boot process.

For example, it sets the hostname or configures the loopback network device.

Apply configuration changes[edit | edit source]

After editing the above files, changes are applied after reboot or by restarting systemd-networkd and systemd-resolved services:

root@desk-mx6:~# systemctl restart systemd-networkd
root@desk-mx6:~# systemctl restart systemd-resolved



Peripherals[edit | edit source]

Peripheral Audio[edit | edit source]

Access to the audio interface is provided by ALSA (Advanced Linux Sound Architecture), which consists in a kernel driver and a users space library for application developers. A set of standard tools (alsa-utils) can be used for simple management of the audio codec.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-sbcx-revb-common.dtsi it is possible to find the codec SSI interface configuration:

    sound {
        compatible = "fsl,imx-audio-tlv320aic31xx";
        model = "sbcx-audio-tlv320aic3100";
        ssi-controller = <&ssi1>;
        audio-codec = <&codec>;
        audio-routing =
            "Speaker", "SPK",
            "Headphone Jack", "HPL",
            "Headphone Jack", "HPR",
            "MIC1LP", "Line In",
            "MIC1LM", "Line In",
            "MIC1RP", "Mic Jack",
            "Mic Jack", "MICBIAS";
        mux-int-port = <1>;
        mux-ext-port = <3>;
        status = "okay";
    };
...
...
&audmux {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_tlv320aic3x_1>;
    status = "okay";
};

&ssi1 {
    status = "okay";
};
...
...
&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hog_sbcx &pinctrl_hog_sbcx_one_piece>;
...
...
    tlv320aic3x {
        pinctrl_tlv320aic3x_1: tlv320aic3x_codecgrp-1{
            fsl,pins = <
                MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x130b0
                MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
                MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
                MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
                MX6QDL_PAD_GPIO_3__XTALOSC_REF_CLK_24M 0x130b0

                MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x130b0
            >;
        };
    };

Accessing the peripheral[edit | edit source]

Access to the audio interface is provided by ALSA (Advanced Linux Sound Architecture), which consists in a kernel driver and a users space library for application developers. A set of standard tools alsa-utils can be used for simple management of the audio codec.

Linux messages at boot time[edit | edit source]

...
...
[    4.408197] fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW
...
...
[    4.964996] ALSA device list:
[    4.971421]   #0: sbcx-audio-tlv320aic3100

To list the audio sound cards just use the aplay utility:

root@desk-mx6:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sbcxaudiotlv320 [sbcx-audio-tlv320aic3100], device 0: HiFi tlv320aic31xx-hifi-0 [HiFi tlv320aic31xx-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Usage speaker-test (from alsa-utils)[edit | edit source]

root@desk-mx6:~# speaker-test -t sine

speaker-test 1.2.6

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Sine wave rate is 440.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 3840 to 5760
Period size range from 1920 to 1920
Using max buffer size 5760
Periods = 4
was set period_size = 1920
was set buffer_size = 5760
 0 - Front Left
Time per period = 2.889438
...
...

In order to unmute the speaker the alsamixer utility can be used.

Additional information[edit | edit source]

Information about alsa-utils can be found on ALSA project wiki pages


Peripheral CAN[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-sbcx-revb-common.dtsi :

&can1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_flexcan1_axel>;
    status = "okay";
};

From imx6qdl-axelcommon.dtsi:

    can1 {
        pinctrl_flexcan1_axel: flexcan1axelgrp-1 {
            fsl,pins = <
                MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000
                MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x80000000
            >;
        };
    };

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

...
...
[    4.455222] can: controller area network core
[    4.464472] can: raw protocol
[    4.467614] can: broadcast manager protocol
[    4.471816] can: netlink gateway - max_hops=1
...
...

Enable the interface and check status[edit | edit source]

root@desk-mx6:~# ip link set can0 type can bitrate 500000
root@desk-mx6:~# ifconfig can0 up
[  839.886499] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
root@desk-mx6:~# ifconfig can0
can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 39

Usage with can-utils[edit | edit source]

root@desk-mx6:~# ip link set can0 type can bitrate 500000 triple-sampling on loopback on                                                                                                                           
root@desk-mx6:~# ifconfig can0 up                                                                                                                                                                          
root@desk-mx6:~# candump can0 &                                                                                                                                                                          
[1] 321
interface = can0, family = 29, type = 3, proto = 1
root@desk-mx6:~# cansend can0 7ff#0001020304050607
  can0  7FF   [8]  00 01 02 03 04 05 06 07
  can0  7FF   [8]  00 01 02 03 04 05 06 07

Additional information[edit | edit source]

Each CAN port appears like a networking interface in the form canX where X is the port number.

Information about programming the CAN socket interface is given in the kernel tree under Documentation/networking/can.rst


Peripheral Ethernet[edit | edit source]

The ethernet interface is made available through the i.MX6 fec interface which should be initialized on the device tree.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-axelcommon.dtsi :

&fec {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet_axel>;
    phy-mode = "rgmii";
    phy-handle = <&\ethphy>;
    status = "okay";

    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        ethphy: ethernet-phy@7 {
            compatible = "ethernet-phy-ieee802.3-c22";
            reg = <7>;
        };
    };
};

&iomuxc {
...
...
    enet {
        pinctrl_enet_axel: enetgrp-1 {
            fsl,pins = <
                MX6QDL_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
                MX6QDL_PAD_ENET_MDC__ENET_MDC         0x1b0b0
                MX6QDL_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
                MX6QDL_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
                MX6QDL_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
                MX6QDL_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
                MX6QDL_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
                MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
                MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
                MX6QDL_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
                MX6QDL_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
                MX6QDL_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
                MX6QDL_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
                MX6QDL_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
                MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
                MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28     0xb0b1
                MX6QDL_PAD_SD4_DAT3__GPIO2_IO11        0xb0b1
                MX6QDL_PAD_SD4_DAT2__GPIO2_IO10        0xb0b1
            >;
        };
    };
...
...
};

Accessing the peripheral[edit | edit source]

AXEL LITE SOM provides the network interface mapped at eth0.

Linux messages at boot time[edit | edit source]

...
...
[    3.355256] fec 2188000.ethernet eth0: registered PHC device 0
...
...
[   16.138362] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:07, irq=POLL)
...
...

Cable connection:

...
...
[   18.235470] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
...
...

Check the interface with ifconfig[edit | edit source]

root@desk-mx6:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.4.186  netmask 255.255.255.0  broadcast 192.168.4.255
        inet6 fe80::b8c5:33ff:fe96:eeb  prefixlen 64  scopeid 0x20<link>
        ether ba:c5:33:96:0e:eb  txqueuelen 1000  (Ethernet)
        RX packets 355  bytes 45752 (44.6 KiB)
        RX errors 0  dropped 75  overruns 0  frame 0
        TX packets 57  bytes 7691 (7.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Test with iperf[edit | edit source]

root@desk-mx6:~# iperf3 -t 5 -c 192.168.4.47
Connecting to host 192.168.4.47, port 5201
[  5] local 192.168.4.186 port 48642 connected to 192.168.4.47 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.4 MBytes  95.4 Mbits/sec    0   96.2 KBytes       
[  5]   1.00-2.00   sec  11.0 MBytes  92.4 Mbits/sec    0    102 KBytes       
[  5]   2.00-3.00   sec  11.1 MBytes  93.2 Mbits/sec    0    106 KBytes       
[  5]   3.00-4.00   sec  11.2 MBytes  93.8 Mbits/sec    0    106 KBytes       
[  5]   4.00-5.00   sec  11.0 MBytes  92.6 Mbits/sec    0    106 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  55.7 MBytes  93.5 Mbits/sec    0             sender
[  5]   0.00-5.05   sec  55.5 MBytes  92.3 Mbits/sec                  receiver
iperf Done.

Gigabit ethernet[edit | edit source]

AXEL LITE SOM provides the 4 twisted pair data line for interfacing a magnetic transformer supporting the Gigabit ethernet interface. Due to the most popular and cheaper 100Mbps interface used in the Industrial field, the standard configuration (hardware and software) for the ethernet interface is 100Mbps. Furthermore, the 1Gps negotiation requires a longer time so, if not required, it is better to keep the interface configured at the real speed used.

The following paragraphs describe how to change the default configuration for supporting 1Gbps ethernet hardware and software configuration.

Hardware connections[edit | edit source]

The AXEL Lite EVK schematics show how to connect the ethernet physical interface to a 10/100Mbs or 1Gbps connectors. For a 1Gbps connection, it is enough to connect all 4 pair lines (in the EVK schematics there is an optional R-Pack RP2 to be mounted)

Software configuration[edit | edit source]

Standard DESK-MX6-L BSP is configured for a 100Mbps interface configuration. For enabling 1Gbps, the following u-boot environment variable has to be defined (and saved) in the environment:

=> setenv disable_giga 0
=> saveenv

U-Boot network driver for the ethernet PHY drivers/net/phy/micrel_ksz90x1.c uses this variable for enabling/disabling the speed and autonegotiation for the 1000 speed.

Moreover, the following device tree entry in the imx6dl-axellite.dtsi (or imx6q-axellite.dtsi if the SOC is a i.MX6Q) file, should be changed from:

&ethphy {
	max-speed = <100>;
};

to:

&ethphy {
	max-speed = <1000>;
};

Limitations[edit | edit source]

As per official NXP Chip errata documentation ERR004512, the i.MX6S/DL/Q have a maximum performance limited to 470Mpbs:

The theoretical maximum performance of 1 Gbps ENET is limited to 470 Mbps (total for Tx and Rx). The actual measured performance in an optimized environment is up to 400 Mbps

Linux messages at boot time[edit | edit source]

Cable connection:

...
...
[   15.360433] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   15.368136] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
...
...

Test with iperf[edit | edit source]

The following test shows a real case with a 390Mbps transfer rate (depending on the testbed) but a >=400Mbps (limited to 470Mbps) can be obtained:

root@desk-mx6:~# iperf3 -c 192.168.8.125
Connecting to host 192.168.8.125, port 5201
[  5] local 192.168.8.106 port 35804 connected to 192.168.8.125 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  46.5 MBytes   390 Mbits/sec    0    352 KBytes
[  5]   1.00-2.00   sec  46.4 MBytes   389 Mbits/sec    0    368 KBytes
[  5]   2.00-3.00   sec  46.5 MBytes   390 Mbits/sec    0    443 KBytes
[  5]   3.00-4.00   sec  47.0 MBytes   394 Mbits/sec    0    443 KBytes
[  5]   4.00-5.00   sec  46.8 MBytes   393 Mbits/sec    0    462 KBytes
[  5]   5.00-6.00   sec  45.4 MBytes   381 Mbits/sec    0    387 KBytes
[  5]   6.00-7.00   sec  46.4 MBytes   389 Mbits/sec    0    410 KBytes
[  5]   7.00-8.00   sec  45.9 MBytes   385 Mbits/sec    0    461 KBytes
[  5]   8.00-9.00   sec  47.4 MBytes   397 Mbits/sec    0    474 KBytes
[  5]   9.00-10.00  sec  46.4 MBytes   389 Mbits/sec    0    495 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   465 MBytes   390 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   463 MBytes   389 Mbits/sec                  receiver

iperf Done.
root@desk-mx6:~#



Peripheral HDMI[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

    hdmi_edid: edid@50 {
        compatible = "fsl,imx6-hdmi-i2c";
        reg = <0x50>;
    };

From imx6qdl-axelcommon.dtsi:

&hdmi_cec {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hdmi_cec_2>;
    status = "okay";
};

&hdmi_core {
    ipu_id = <0>;
    disp_id = <0>;
    status = "okay";
};

&hdmi_video {
    fsl,phy_reg_vlev = <0x0294>;
    fsl,phy_reg_cksymtx = <0x800d>;
    status = "okay";
};

&iomuxc {
...
...
    hdmi_cec {
        pinctrl_hdmi_cec_2: hdmicecgrp-2 {
            fsl,pins = <
                MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE 0x1f8b0
            >;
        };
    };
...
...
};

Accessing the peripheral[edit | edit source]

For enabling the HDMI device, it is required to instantiate its framebuffer with the related configuration and changing the display ID of hdmi_core, for example, with a 1920x1080p60 display:

&mxcfb3 {
	compatible = "fsl,mxc_sdc_fb";
	disp_dev = "hdmi";
	interface_pix_fmt = "RGB24";
	mode_str ="1920x1080M@60";
	default_bpp = <32>;
	status = "okay";
};

&hdmi_core {
    ipu_id = <0>;
    disp_id = <1>;
    status = "okay";
};

Linux messages at boot time[edit | edit source]

...
...
[    3.784909] mxc_hdmi 20e0000.hdmi_video: supply HDMI not found, using dummy regulator
[    4.098068] mxc_hdmi 20e0000.hdmi_video: Detected HDMI controller 0x13:0x1a:0xa0:0xc1
[    4.110974] mxc_sdc_fb fb@2: registered mxc display driver hdmi
...
...

Additional information[edit | edit source]

HDMI framebuffer can be accessed through the standard /dev/fbX fb device.

The configured framebuffer can be checked using standard fbset utility:

root@desk-mx6:~# fbset -fb /dev/fb2 

mode "1920x1080-60"
    # D: 148.500 MHz, H: 67.500 kHz, V: 60.000 Hz
    geometry 1920 1080 1920 1080 32
    timings 6734 148 88 36 4 44 5
    hsync high
    vsync high
    rgba 8/16,8/8,8/0,8/24
endmode


Peripheral LVDS[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From the carrier board device tree where two LVDS channel have been configured for a dual LVDS panel (two 800x480 18bit):

&ldb {
	status = "okay";

	lvds-channel@0 {
		fsl,data-mapping = "spwg";
		fsl,data-width = <18>;
		crtc = "ipu2-di0";
		status = "okay";
		primary;

		display-timings {
			native-mode = <&timing0>;
			timing0: am_800480stmqw_ta1 {
				clock-frequency = <33260000>;
				hactive = <800>;
				vactive = <480>;
				hback-porch = <128>;
				hfront-porch = <128>;
				vback-porch = <15>;
				vfront-porch = <30>;
				hsync-len = <10>;
				vsync-len = <2>;
			};
		};
	};

	lvds-channel@1 {
		fsl,data-mapping = "spwg";
		fsl,data-width = <18>;
		crtc = "ipu2-di1";
		status = "okay";

		display-timings {
			native-mode = <&timing1>;
			timing1: am_800480stmqw_ta1 {
				clock-frequency = <33260000>;
				hactive = <800>;
				vactive = <480>;
				hback-porch = <128>;
				hfront-porch = <128>;
				vback-porch = <15>;
				vfront-porch = <30>;
				hsync-len = <10>;
				vsync-len = <2>;
			};
		};
	};
};

From imx6qdl-axelcommon.dtsi:

&iomuxc {
...
...
    ipu1 {
        pinctrl_ipu1_1: ipu1grp-1 {
            fsl,pins = <
                MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
                MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0x10
                MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
                MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
                MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04        0x80000000
                MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0x10
                MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
                MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
                MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
                MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
                MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
                MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
                MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
                MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
                MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
                MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
                MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
                MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
                MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
                MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
                MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
                MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
                MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0x10
                MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0x10
                MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0x10
                MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0x10
                MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0x10
                MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0x10
                MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0x10
            >;
        };
    };
...
...
};

Accessing the peripheral[edit | edit source]

For enabling the two devices, it is required to instantiate both framebuffers with the related configuration, for example into the carrier device tree:

mxcfb1: fb@0 {
    memory-region = <&display_reserved>;
    compatible = "fsl,mxc_sdc_fb";
    disp_dev = "ldb";
    interface_pix_fmt = "RGB24";
    default_bpp = <32>;
    int_clk = <0>;
    late_init = <0>;
    status = "okay";
};

mxcfb2: fb@1 {
    compatible = "fsl,mxc_sdc_fb";
    disp_dev = "ldb";
    interface_pix_fmt = "RGB666";
    default_bpp = <16>;
    int_clk = <0>;
    late_init = <0>;
    status = "okay";
};

Linux messages at boot time[edit | edit source]

...
...
[    3.794432] mxc_sdc_fb fb@0: registered mxc display driver ldb
[    3.800471] mxc_sdc_fb fb@0: using reserved memory region at 0x4fc00000, size 2 MiB
[    3.808249] mxc_sdc_fb fb@0: assigned reserved memory node splashscreen
[    3.815046] mxc_sdc_fb fb@0: using memory region 0x4fc00000 0x4fdfffff
...
...

Additional information[edit | edit source]

LDB framebuffer can be accessed through the standard /dev/fbX fb device.

The configured framebuffer can be checked using standard fbset utility:

root@desk-mx6:~# fbset -fb /dev/fb0

mode "800x480-59"
    # D: 33.260 MHz, H: 31.201 kHz, V: 59.205 Hz
    geometry 800 480 800 480 16
    timings 30066 128 128 15 30 10 2
    rgba 5/11,6/5,5/0,0/0
endmode


Peripheral MIPI[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&mipi_csi {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_mipi_csi_axel_sbc>;
    status = "okay";
    ipu_id = <0>;
    csi_id = <1>;
    v_channel = <0>;
    lanes = <2>;
};

From imx6qdl-axelcommon.dtsi:


&iomuxc {
...
...
        pinctrl_mipi_csi_axel_sbc: mipi_csigrp-2 {
            fsl,pins = <
                MX6QDL_PAD_SD3_DAT7__GPIO6_IO17 0x0b0b0 /* ov5640 mipi powerdown */
                MX6QDL_PAD_SD3_DAT6__GPIO6_IO18 0x000b0 /* ov5640 mipi reset */
                MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1 0x000b0 /* ov5640 mclk */
            >;
        };
...
...
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

MIPI CSI-2 driver initialized:

...
...
[    0.142280] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 driver probed
[    0.142301] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 dphy version is 0x3130302a
[    0.142757] MIPI CSI2 driver module loaded
...
...

and if a MIPI camera is inserted, it has been recognized and its video driver loaded:

root@desk-mx6:~# dmesg | grep -i camera
[    4.844134] camera ov5640_mipi is found
root@desk-mx6:~# ls -la /dev/video1*
crw-rw---- 1 root video 81, 1 Apr  4 06:49 /dev/video1
crw-rw---- 1 root video 81, 2 Apr  4 06:49 /dev/video16
crw-rw---- 1 root video 81, 3 Apr  4 06:49 /dev/video17
crw-rw---- 1 root video 81, 4 Apr  4 06:49 /dev/video18

Usage with gstreamer[edit | edit source]

Video capture and display using OV5640 MIPI camera:

root@desk-mx6:~# gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! imxv4l2sink
...
...
====== IMXV4L2SRC: 4.7.2 build on Sep  1 2022 09:49:28. ======
====== IMXV4L2SINK: 4.7.2 build on Sep  1 2022 09:49:28. ======
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (800x480).
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
Redistribute latency...
v4l2sink need allocate 3 buffers.
...
...

Additional information[edit | edit source]

More information about gstreamer on its web site.

More information about i.MX gstreamer plugin on the gstreamer-imx web site




Peripheral SD[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&usdhc1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc1_sbcx>;
    no-1-8-v;
    keep-power-in-suspend;
    enable-sdio-wakeup;
    cd-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; /* GPIO3_19 */
    status = "okay";
};
...
...
&iomuxc {
...
...
    usdhc1 {
        pinctrl_usdhc1_sbcx: usdhc1grp-1{
            fsl,pins = <
                MX6QDL_PAD_SD1_CMD__SD1_CMD    0x17060
                MX6QDL_PAD_SD1_CLK__SD1_CLK    0x10060
                MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17060
                MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17060
                MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17060
                MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17060
                /* card detect */
                MX6QDL_PAD_EIM_D19__GPIO3_IO19  0x1b0b0
            >;
        };
    };
...
...
};

The USDHC interface is re-configured on carrier device tree because of the Card Detect pin (which is related to the real board hardware implementation).

Accessing the peripheral[edit | edit source]

Once initialized, the SD device is mapped to the standard /dev/mmcblk0pX block device, depending on how many partition are created on the SD card.

Linux messages at boot time[edit | edit source]

If the microSd card is inserted at boot time, the kernel - once the USDHC interface has been initialized - prints the device information and the partition detected like p1, p2, etc.:

...
...
[    4.561266] sdhci: Secure Digital Host Controller Interface driver
[    4.567479] sdhci: Copyright(c) Pierre Ossman
[    4.571840] sdhci-pltfm: SDHCI platform and OF driver helper
[    4.615639] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    4.664698] mmc0: host does not support reading read-only switch, assuming write-enable
[    4.681355] mmc0: new high speed SDHC card at address aaaa
[    4.687736] mmcblk0: mmc0:aaaa SL32G 29.7 GiB 
...
...
[    4.710742]  mmcblk0: p1 p2
[    5.294335] EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem
[    5.343233] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    8.611380] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: none.
...
...

Additional information[edit | edit source]

If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:

root@desk-mx6:~# mkdir -p /mnt/boot
root@desk-mx6:~# mkdir -p /mnt/rfs
root@desk-mx6:~# mount /dev/mmcblk0p1 /mnt/boot
root@desk-mx6:~# mount /dev/mmcblk0p2 /mnt/rfs
root@desk-mx6:~#

and then the mounted partition are available on the /mnt/boot and /mnt/rfs root file system directories.



Peripheral UART[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&uart2 {
	fsl,uart-has-rtscts;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_dwm_uart2_1>;
	status = "okay";
};

From imx6qdl-axelcommon.dtsi:

    uart2 {
        pinctrl_dwm_uart2_1: dwm_uart2_grp-1 {
            fsl,pins = <
                MX6QDL_PAD_SD3_DAT4__UART2_RX_DATA 0x1b0b1
                MX6QDL_PAD_SD3_DAT5__UART2_TX_DATA 0x1b0b1
                MX6QDL_PAD_SD3_CMD__UART2_CTS_B 0x1b0b1
                MX6QDL_PAD_SD3_CLK__UART2_RTS_B 0x1b0b1
            >;
        };

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

...
...
[    0.302170] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 78, base_baud = 5000000) is a IMX
[    0.303041] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 79, base_baud = 5000000) is a IMX
[    0.569731] printk: console [ttymxc2] enabled
[    0.582478] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 80, base_baud = 5000000) is a IMX
[    0.594030] 21f4000.serial: ttymxc4 at MMIO 0x21f4000 (irq = 81, base_baud = 5000000) is a IMX
...
...
root@imx6qxelk:~#

Configuring the RS232/RS485 mode[edit | edit source]

When the UART5 (aka /dev/ttymxc4 device in Linux) is properly configured using the hardware jumpers (see Interfaces and Connectors - UART5 EVK page), the MultiProtocol transceiver pins has to be initialized for setting the related user selectable modes: the RS232 or RS485 mode can be selected with the gpio-leds class and the led rs232_on.

From imx6q-sbcx-cb0012.dts or imx6dl-sbcx-cb0012.dts:

    leds {
	compatible = "gpio-leds";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rs232_485_422_1>;

	rs232_485_422 {
		gpios = <&gpio7 13 GPIO_ACTIVE_HIGH>;
		linux,default-trigger = "default-on";
	};

	rs232_on {
		gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "default-on";
	};
    };
RS232 mode[edit | edit source]

This is the default protocol mode; this can be also activated (when different) using the following command:

root@desk-mx6:~# echo 0 > /sys/class/leds/rs232_on/brightness
RS485 mode[edit | edit source]

This mode can be activated using the following command:

root@desk-mx6:~# echo 255 > /sys/class/leds/rs232_on/brightness

Usage with stty[edit | edit source]

N.B. UART mapping respect to ttymxcX is the following one:

UART1 <-> ttymxc0
UART2 <-> ttymxc1
UART3 <-> ttymxc2
UART4 <-> ttymxc3
...
root@desk-mx6:~# stty -F /dev/ttymxc3 115200 -echo
root@desk-mx6:~# cat /dev/ttymxc3 &
[2] 555
root@desk-mx6:~# echo "Test loopback" > /dev/ttymxc3
root@desk-mx6:~# Test loopback

Additional information[edit | edit source]

Serial ports can be used through the standard serial programming API.

For detailed information, please refer to the Serial Programming HOWTO at Serial-Programming-HOWTO



Peripheral USB Host[edit | edit source]

The USB Host port requires to configure the USB VBUS regulator and the gpio used for enabling the 5V USB power switch.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-axelcommon.dtsi:

    regulators {
        compatible = "simple-bus";
 
        reg_usb_h1_vbus: usb_h1_vbus {
            compatible = "regulator-fixed";
            regulator-name = "usb_h1_vbus";
            regulator-min-microvolt = <5000000>;
            regulator-max-microvolt = <5000000>;
            gpio = <&gpio2 11 0>;
            enable-active-high;
        };
    };
...
...
&usbh1 {
    vbus-supply = <&reg_usb_h1_vbus>;
    status = "okay";
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

When a USB peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. xlass, vendor id, product id, etc.)

[  949.174288] usb 1-1: New USB device found, idVendor=13fe, idProduct=6700, bcdDevice= 1.10
[  949.182598] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  949.192339] usb 1-1: Product: USB DISK 3.0
[  949.196474] usb 1-1: Manufacturer: Wilk
[  949.202608] usb 1-1: SerialNumber: 07012533C2BE5935
[  949.216478] usb-storage 1-1:1.0: USB Mass Storage device detected
[  949.234501] scsi host0: usb-storage 1-1:1.0
[  950.319317] scsi 0:0:0:0: Direct-Access     Wilk     USB DISK 3.0     PMAP PQ: 0 ANSI: 6
[  950.334575] sd 0:0:0:0: [sda] 60628992 512-byte logical blocks: (31.0 GB/28.9 GiB)
[  950.343311] sd 0:0:0:0: [sda] Write Protect is off
[  950.357023] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  950.421972]  sda: sda1 sda2
[  950.433822] sd 0:0:0:0: [sda] Attached SCSI removable disk

Additional information[edit | edit source]

If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:

root@desk-mx6:~# mkdir -p /mnt/usb
root@desk-mx6:~# mount /dev/sda1 /mnt/usb/
root@desk-mx6:~# ls -la /mnt/usb/
total 24
drwxrwx--- 3 root disk    16384 Jan  1  1970 .
drwxr-xr-x 6 root root     4096 Apr  4 07:11 ..
drwxrwx--- 3 root disk     2048 Apr  5  2011 EFI
-rwxrwx--- 1 root disk 10193056 Apr  5  2011 uImage



Peripheral USB OTG[edit | edit source]

The USB OTG feature can be easily tested using the Mass Storage Gadget, which lets the device export a file as a mass storage device to the connected PC.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-axelcommon.dtsi:


        reg_usb_otg_vbus: usb_otg_vbus {
                compatible = "regulator-fixed";
                regulator-name = "usb_otg_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
                gpio = <&gpio4 14 0>;
                enable-active-high;
        };
...
...
&usbotg {
    vbus-supply = <&reg_usb_otg_vbus>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usbotg_2>;
    disable-over-current;
    status = "okay";
};
...
...
&iomuxc {
...
...
    usbotg {
        pinctrl_usbotg_2: usbotggrp-2 {
            fsl,pins = <
                MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
            >;
        };
    };
};

Accessing the peripheral[edit | edit source]

Usage with mass-storage[edit | edit source]

root@desk-mx6:~# dd if=/dev/zero of=mass_storage count=256 bs=1M
256+0 records in
256+0 records out
268435456 bytes (268 MB, 256 MiB) copied, 8.63267 s, 31.1 MB/s
root@desk-mx6:~# mkfs.msdos mass_storage
mkfs.fat 4.2 (2021-01-31)
root@desk-mx6:~# mkdir loop
root@desk-mx6:~# mount -o loop mass_storage loop
[  176.970284] loop0: detected capacity change from 0 to 524288
root@desk-mx6:~# echo "Test USB OTG with mass storage device" > loop/usb.txt
root@desk-mx6:~# umount loop

then insert the g_mass_storage kernel module driver enabling an Windows PC to see it as a removable device

root@desk-mx6:~# modprobe g_mass_storage removable=y file=mass_storage
root@desk-mx6:~# dmesg | tail -n 7
[  157.011126] Mass Storage Function, version: 2009/09/11
[  157.011146] LUN: removable file: (no medium)
[  157.011252] LUN: removable file: /home/root/mass_storage
[  157.011263] Number of LUNs=1
[  157.012243] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[  157.012263] g_mass_storage gadget: userspace failed to provide iSerialNumber
[  157.012272] g_mass_storage gadget: g_mass_storage ready

Once the USB cable is connected to the PC, the storage is mounted and the usb.txt file is available:

$ cat /media/user/0001-66DD/usb.txt 
Test USB OTG with mass storage device

The Windows PC also activate the driver and the disk is available as a Drive Unit (with the usb.txt file available).

Additional information[edit | edit source]

More information about Mass Storage Gadget driver is given in the kernel tree under Documentation/usb/mass-storage.rst



Peripheral PCI express[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&pcie {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_pci_axel_sbc>;
    reset-gpio = <&gpio5 27 0>;
    wake-up-gpio = <&gpio5 20 0>;
    disable-gpio = <&gpio5 26 0>;
    status = "okay";
};

From imx6qdl-axelcommon.dtsi:


&iomuxc {
...
...
    pcie {
        pinctrl_pci_axel_sbc: pci_grp-1 {
            fsl,pins = <
                MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20     0x1b0b0 /* PCIE_WAKE_B */
                MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27        0x1b0b0 /* PCIE_RST_B */
                MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26        0x1b0b0 /* PCIE_DIS_B */
            >;
        };
    };
...
...
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

PCIe driver initialized:

...
...
[    0.158611] PCI: CLS 0 bytes, default 64
[    0.265640] imx6q-pcie 1ffc000.pcie: supply epdev_on not found, using dummy regulator
[    0.306554] imx6q-pcie 1ffc000.pcie: iATU unroll: disabled
[    0.306566] imx6q-pcie 1ffc000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    0.306592] imx6q-pcie 1ffc000.pcie: host bridge /soc/pcie@1ffc000 ranges:
[    0.306654] imx6q-pcie 1ffc000.pcie:       IO 0x0001f80000..0x0001f8ffff -> 0x0000000000
[    0.306685] imx6q-pcie 1ffc000.pcie:      MEM 0x0001000000..0x0001efffff -> 0x0001000000
[    0.306809] imx6q-pcie 1ffc000.pcie: iATU unroll: disabled
[    0.306819] imx6q-pcie 1ffc000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    0.405002] imx6q-pcie 1ffc000.pcie: Link up
[    0.405013] imx6q-pcie 1ffc000.pcie: Link: Gen2 disabled
[    0.405022] imx6q-pcie 1ffc000.pcie: Link up, Gen1
[    0.528786] imx6q-pcie 1ffc000.pcie: Link up
[    0.528968] imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
...
...
[    3.472568] ehci-pci: EHCI PCI platform driver
...
...

The PCIe usage is strictly related to the peripheral type connected to the PCIe slot. Then, the peripheral type defines the Linux commands used for the accessing (hiding the PCIe bus commands)

Additional information[edit | edit source]



Peripheral GPIOs[edit | edit source]

i.MX6 can handle external pins in many different ways and most of them can be configured as GPIOs. When a pin is set as a GPIO, it is possible to read its value, change its direction or change output value directly from the shell.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration for using the RS-485 GPIOs used on standard DAVE's kit for the AXEL Lite SOM:

From imx6q-sbcx-cb0012.dts:

    leds {
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_rs232_485_422_1>;

        rs232_485_422 {
            gpios = <&gpio7 13 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "default-on";
        };

        rs232_on {
            gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
            linux,default-trigger = "default-on";
        };
    };
};

From mx6qdl-sbcx-revb-common.dtsi:

    rs232_485_422 {
        pinctrl_rs232_485_422_1: pinctrl_rs232_485_422_grp-1 {
            fsl,pins = <
                MX6QDL_PAD_GPIO_18__GPIO7_IO13      0x1b0b1 /* UART5_485/232 */
                MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29   0x1b0b1 /* UART5_ON */
            >;
        };
    };

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

With the previous leds configuration for the GPIOs, it is possible to find them on sysfs under /sys/class/leds sub-directory:

root@desk-mx6:~# ls -la /sys/class/leds/
total 0
drwxr-xr-x  2 root root 0 Apr 28  2022 .
drwxr-xr-x 58 root root 0 Apr 28  2022 ..
lrwxrwxrwx  1 root root 0 Apr 28  2022 mmc0:: -> ../../devices/platform/soc/2100000.bus/2190000.mmc/leds/mmc0::
lrwxrwxrwx  1 root root 0 Apr 28  2022 mmc1:: -> ../../devices/platform/soc/2100000.bus/2194000.mmc/leds/mmc1::
lrwxrwxrwx  1 root root 0 Apr 28  2022 rs232_485_422 -> ../../devices/platform/leds/leds/rs232_485_422
lrwxrwxrwx  1 root root 0 Apr 28  2022 rs232_on -> ../../devices/platform/leds/leds/rs232_on

Userspace gpio access[edit | edit source]

Usage with sysfs[edit | edit source]

  • set EIM_D26 (MX6QDL_PAD_EIM_D26__GPIO3_IO26) as output GPIO
    • GPIO3_IO26 => (n-1)*32 + IO = (3-1)*32+26 = 90
root@desk-mx6:~# echo 90 > /sys/class/gpio/export
root@desk-mx6:~# echo out > /sys/class/gpio/gpio90/direction
root@desk-mx6:~# echo 1 > /sys/class/gpio/gpio90/value
root@desk-mx6:~#
  • set EIM_D27 (MX6QDL_PAD_EIM_D27__GPIO3_IO27) as input GPIO
root@desk-mx6:~# echo 91 > /sys/class/gpio/export
root@desk-mx6:~# echo in > /sys/class/gpio/gpio91/direction
root@desk-mx6:~# cat /sys/class/gpio/gpio91/value
1
root@desk-mx6:~#
Additional information[edit | edit source]

Information about GPIOs usage under sysfs directory https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

Usage with libgpiod[edit | edit source]

Warning-icon.png sysfs GPIO ABI has been deprecated. See more information here about it. A character device access has to be used, more information here Warning-icon.png

Information about GPIOs library libgpiod - C library and tools - can be found on git.kernel.org

libgpiod example[edit | edit source]

It is possible yo cross-compile libgpiod in the target (if the related Yocto package is not available for installation). Once the autoconf-archive package has been installed

dnf install autoconf-archive

it is possible to clone the libgpiod git repository and compile the related sources:

git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
cd libgpiod 
./autogen.sh --enable-tools=yes --prefix=/usr/local 
make
make install

Once installed, the gpio utilities are availabel in the target:

root@desk-mx6:~# gpio
gpiodetect  gpiofind    gpioget     gpioinfo    gpiomon     gpioset
gpio interrupt example[edit | edit source]

If a push button, with proper pull-up, is connected to a GPIO line available - for example using the J33.34 pin available on SBC AXEL Lite WIDE connector - the related GPIO can be used as an interrupt:

  • J33.40 is connected to J10.40 SOM pin
    • J33 connector is the WIDE connector in the AXEL Lite EVK
    • J10 connector is the SO-DIMM connector in the AXEL Lite EVK
    • ALT-5 alternate function for this pin is GPIO1_IO06
  • the corresponding pin number is 0 6
  • gpiomon utility can be used for monitor the pin status and triggering, for example, the falling-edge event:
root@desk-mx6:~# gpiomon --falling-edge 0 6
event: FALLING EDGE offset: 6 timestamp: [     696.463539802]
event: FALLING EDGE offset: 6 timestamp: [     696.643661944]
^Croot@desk-mx6:~#