DART-6UL U-Boot features: Difference between revisions

From Variscite Wiki
(Undo revision 8283 by Aviad (talk))
(Undo revision 8282 by Aviad (talk))
Line 1: Line 1:
= Yocto =
{{PageHeader|DART-6UL - U-Boot features}} {{DocImage|category1=DART-6UL|category2=}}
== Documentation ==
=== Morty 2.2.1 ===
<section begin=YOCTO_DOC_2.2.1/>
* Yocto Project Core - Morty 2.2.1 (released on 02/24/2017)
Documentation is available from [https://www.yoctoproject.org/downloads/core/morty221 www.yoctoproject.org]
<section end=YOCTO_DOC_2.2.1/>
=== FSLC BSP 2.2 ===
<section begin=YOCTO_DOC_FSLC_BSP_2.2/>
* FSL Community BSP Release Notes 2.2 documentation
Documentation is available from [http://freescale.github.io/doc/release-notes/2.2/ http://freescale.github.io]
<section end=YOCTO_DOC_FSLC_BSP_2.2/>
=== FSL BSP L4.1.15_2.0.0-ga ===
<section begin=YOCTO_DOC_FSL_BSP_L4.1.15_2.0.0-ga/>
*Kernel documentation from fsl-yocto-L4.1.15_2.0.0-ga release
Documentation is available for download from fsl-yocto-imx-4.1.15_2.0.0-docs
<section end=YOCTO_DOC_FSL_BSP_L4.1.15_2.0.0-ga/>


= VAR-SOM-MX6 =
== USB ports ==
== Build Results ==
In the DART-6UL U-Boot:<br>
<section begin=VAR-SOM-MX6_BUILD_RESULTS/>
USB port 1 (lower type-A receptacle) is defined as USB Host.<br>
{| class="wikitable"
USB port 0 (micro USB receptacle / upper type-A receptacle) is defined as USB Client.
|-
! scope="col" | Device Tree Name<br/>
! scope="col" | SOM type<br/>
! scope="col" | Carrier Board type<br/>
! scope="col" | LCD Type<br/>
! scope="col" | Evaluation Kit name<br/>
|-
| style="padding: 5px;"| uImage-imx6q-var-som-cap.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (Quad / Dual)
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Capacitive touch
| style="padding: 5px;"| VAR-DVK-MX6_V2-PRO<br>VAR-STK-MX6_V2
|-
| style="padding: 5px;"| uImage-imx6q-var-som-res.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (Quad / Dual)
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Resistive touch
| style="padding: 5px;"| VAR-DVK-MX6_V2-PRO<br>VAR-STK-MX6_V2
|-
| style="padding: 5px;"| uImage-imx6q-var-som-vsc.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (Quad / Dual)
| style="padding: 5px;"| VAR-SOLOCustomBoard
| style="padding: 5px;"| Capacitive LVDS touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-cap.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (DualLite/ Solo)
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Capacitive touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-res.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (DualLite/ Solo)
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Resistive touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-vsc.dtb
| style="padding: 5px;"| VAR-SOM-MX6_V2 (DualLite/ Solo)
| style="padding: 5px;"| VAR-SOLOCustomBoard
| style="padding: 5px;"| Capacitive LVDS touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-solo-vsc.dtb
| style="padding: 5px;"| VAR-SOM-SOLO / VAR-SOM-DUAL
| style="padding: 5px;"| VAR-SOLOCustomBoard
| style="padding: 5px;"| Capacitive LVDS touch
| style="padding: 5px;"| VAR-DVK-SOLO/DUAL<br>VAR-STK-SOLO/DUAL
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-solo-cap.dtb
| style="padding: 5px;"| VAR-SOM-SOLO / VAR-SOM-DUAL
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Capacitive touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6dl-var-som-solo-res.dtb
| style="padding: 5px;"| VAR-SOM-SOLO / VAR-SOM-DUAL
| style="padding: 5px;"| VAR-MX6CustomBoard
| style="padding: 5px;"| Resistive touch
| style="padding: 5px;"| N/A
|-
| style="padding: 5px;"| uImage-imx6q-var-dart.dtb
| style="padding: 5px;"| VAR-SOM-SOLO / VAR-SOM-DUAL
| style="padding: 5px;"| VAR-DT6CustomBoard
| style="padding: 5px;"| Capacitive LVDS touch
| style="padding: 5px;"| VAR-DVK-DT6<br>VAR-STK-DT6
|-
|}
<section end=VAR-SOM-MX6_BUILD_RESULTS/>


== Device tree ==
== USB Mass Storage gadget ==
<section begin=VAR-SOM-MX6_DTB/>
You can use the board as a USB Mass Storage device:<br>
You will be able to access all the partitions of any block device that is on the board or connected to it, from your host PC - You will see them as /dev/sdXX, just like connecting a regular USB storage to your PC, and you'll be able to mount them, and have full read/write access to them. You can even use it to flash a new U-Boot, re-partition the storage, re-format it, etc.<br>
This is especially useful for updating the internal eMMC.<br><br>
To do this you need to connect a USB cable between the USB Client port of the board and a regular USB Host port on your PC, and use U-Boot's ums command.<br><br>
 
General ums usage is:
<pre>
<pre>
Build the device tree for Dualite/Solo on VAR-MX6CustomBoard with capacitive touchscreen:
ums <USB_controller> [<devtype>] <devnum>  e.g. ums 0 mmc 0
$ make -j4 imx6dl-var-som-cap.dtb
    devtype defaults to mmc
</pre>
devtype can be any block device (e.g. mmc, usb)<br><br>


Build the device tree for Dualite/Solo on VAR-MX6CustomBoard with resistive touchscreen:
To mount the eMMC:<br>
$ make -j4 imx6dl-var-som-res.dtb
<pre>
=> ums 0 mmc 1
</pre>
To mount an SD card:<br>
<pre>
=> ums 0 mmc 0
</pre>
Depending on your host PC, it may automatically mount it or not. If not, you can use dmesg to see the names of the device and its partitions (it should be in the form of /dev/sdXX) and mount them yourself.<br>
To exit the ums command and disconnect the USB device press ctrl+c.<br><br>


Build the device tree for Dualite/Solo on VAR-SOLOCustomBoard:
Note: You should use a Linux PC host as Windows can't naturally read ext file systems.<br><br>
$ make -j4 imx6dl-var-som-vsc.dtb


Build the device tree for Quad/Dual on VAR-MX6CustomBoard with capacitive touchscreen:
== USB Ethernet Gadget ==
$ make -j4 imx6q-var-som-cap.dtb
The USB Ethernet gadget allows you to make the board act as a USB Ethernet device when connecting its USB Client port to a host PC using a USB cable.<br>
Basically, it allows for "Ethernet over USB".<br>
This is especially useful if you build a custom board without an Ethernet interface and you want to boot via network using TFTP.<br><br>


Build the device tree for Quad/Dual on VAR-MX6CustomBoard with resistive touchscreen:
For this, a new Ethernet interface called <span style="font-family:Consolas;">usb_ether</span> was added to U-Boot.<br><br>
$ make -j4 imx6q-var-som-res.dtb


Build the device tree for Quad/Dual on VAR-SOLOCustomBoard:
Before actually using it you should get to know the following environment variables:<br>
$ make -j4 imx6q-var-som-vsc.dtb
Variables specific to this gadget:
<pre>
usbnet_devaddr  - The virtual MAC address of the device (the board side) - f8:dc:7a:00:00:02 by default.
usbnet_hostaddr - The virtual MAC address of the host (the PC side) - f8:dc:7a:00:00:01 by default.
</pre>
General network variables:
<pre>
ethprime - Sets the primary Ethernet interface. This is the interface that will be tried first.
ethact  - Sets the currently active Ethernet interface. Normally, it is modified by the Ethernet driver, but you can change it if you want to override.
ipaddr  - IP address of the device - needed for tftp command.
netmask  - Subnet Mask.
serverip - TFTP server IP address - needed for tftp command.
</pre>
So, for example:
<pre>
=> setenv ethact usb_ether
=> setenv ipaddr 192.168.0.100
=> setenv netmask 255.255.255.0
=> setenv serverip 192.168.0.101
</pre>
And now your are ready to use <span style="font-family:Consolas;">tftpboot</span> over the <span style="font-family:Consolas;">usb_ether</span> interface.<br><br>


Build the device tree for VAR-SOM-SOLO on VAR-MX6CustomBoard with capacitive touchscreen:
Notes:
$ make -j4 imx6dl-var-som-solo-cap.dtb
* Once you run a network command, e.g. tftpboot, the gadget will be connected to your host PC and a new network adapter will be added to it, for the duration of the network interaction.
* Note that you may need to configure your host PC to use the new network adapter properly - this configuration is OS dependent.<br><br>


Build the device tree for VAR-SOM-SOLO on VAR-MX6CustomBoard with resistive touchscreen:
= General U-Boot commands =
$ make -j4 imx6dl-var-som-solo-res.dtb


Build the device tree for VAR-SOM-SOLO on VAR-SOLOCustomBoard:
== List all supported commands and their description/usage (help command) ==
$ make -j4 imx6dl-var-som-solo-vsc.dtb
List all supported commands with a brief description for each one:
<pre>
=> help
</pre>
Print the description and usage of 'command':
<pre>
=> help command
</pre><br>


Build the device tree for DART-MX6:
== Environment handling commands ==
$ make -j4 imx6q-var-dart.dtb
Print the values of all environment variables:
<pre>
=> printenv
</pre>
</pre>
<section end=VAR-SOM-MX6_DTB/>
Print value of environment variable 'name':
<pre>
=> printenv name
</pre>
Set environment variable 'name' to 'value ...':
<pre>
=> setenv name value ...
</pre>
Delete environment variable 'name':
<pre>
=> setenv name
</pre>
Reset default environment:
<pre>
=> env default -a
</pre>
Save environment variables to persistent storage:
<pre>
=> saveenv
</pre><br>


== SD card image file tree ==
== File System access ==
<section begin=VAR-SOM-MX6_SD_TREE/>
List files in a directory (default /):
<pre>
<pre>
/opt/images/
=> ls <interface> [<dev[:part]>] [directory]
└── Yocto
    ├── SPL-nand
    ├── SPL-sd
    ├── imx6dl-var-som-cap.dtb
    ├── imx6dl-var-som-res.dtb
    ├── imx6dl-var-som-solo-cap.dtb
    ├── imx6dl-var-som-solo-res.dtb
    ├── imx6dl-var-som-solo-vsc.dtb
    ├── imx6dl-var-som-vsc.dtb
    ├── imx6q-var-dart.dtb
    ├── imx6q-var-som-cap.dtb
    ├── imx6q-var-som-res.dtb
    ├── imx6q-var-som-vsc.dtb
    ├── rootfs.tar.bz2
    ├── rootfs.ubi
    ├── u-boot.img-nand
    ├── u-boot.img-sd
    └── uImage
</pre>
</pre>
<section end=VAR-SOM-MX6_SD_TREE/>
For example:
<pre>
List files in the BOOT partition of our NAND/eMMC Recovery SD card (after booting from it):
=> ls mmc 0:1


== Flash Recovery SD from GUI ==
List files in directory /opt/images/Yocto in the rootfs partition of our NAND/eMMC Recovery SD card (after booting from it):
<section begin=VAR-SOM-MX6_FLASH_SD_FROM_GUI/>
=> ls mmc 0:2 /opt/images/Yocto
[[File:VAR-SOM-MX6_Krogoth_Recovery.png]]
</pre><br>
<br><br>
Click the appropriate button:
* Install Yocto SOLOCB NAND: Flash Yocto on NAND flash, on [http://www.variscite.com/products/single-board-computers/var-solocustomboard VAR-SOLOCustomBoard]
* Install Yocto SOLOCB eMMC: Flash Yocto on eMMC, on [http://www.variscite.com/products/single-board-computers/var-solocustomboard VAR-SOLOCustomBoard]
* Install Yocto MX6CB Res NAND: Flash Yocto with Resistive touch panel support on NAND flash, on [http://www.variscite.com/products/single-board-computers/var-mx6customboard VAR-MX6CustomBoard]
* Install Yocto MX6CB Cap NAND: Flash Yocto with Capacitive touch panel support on NAND flash, on [http://www.variscite.com/products/single-board-computers/var-mx6customboard VAR-MX6CustomBoard]
* Install Yocto MX6CB Res eMMC: Flash Yocto with Resistive touch panel support on eMMC, on [http://www.variscite.com/products/single-board-computers/var-mx6customboard VAR-MX6CustomBoard]
* Install Yocto MX6CB Cap eMMC: Flash Yocto with Capacitive touch panel support on eMMC, on [http://www.variscite.com/products/single-board-computers/var-mx6customboard VAR-MX6CustomBoard].
* Install Yocto DART (eMMC): Flash Yocto on eMMC, on [http://www.variscite.com/products/single-board-computers/dt6customboard VAR-DT6CustomBoard]<section end=VAR-SOM-MX6_FLASH_SD_FROM_GUI/>


== Setting the Boot Mode ==
Load binary file 'filename' from a partition to RAM address 'addr':
<section begin=VAR-SOM-MX6_BOOT_BOARD/>
<pre>
Follow the instruction below according to the appropriate carrier board type:
=> load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
=== MX6CustomBoard ===
</pre>
Booting your MX6CustomBoard system from SD card requires pushing the middle button while powering up the system. See picture below.
For example:
[[File:Mx6_boot.jpg|thumb|none|upright=2.0]]
<pre>
To boot a board using an SD card, follow the steps below:<br>
Load /boot/splash.bmp from the rootfs partition of our NAND/eMMC Recovery SD card (after booting from it) to RAM address 0x18100000:
* Power-off the board.
=> load mmc 0:2 0x18100000 /boot/splash.bmp
* Insert the SD card into the SD/MMC slot of the carrier board (DVK)
</pre><br>
* Push the middle button (Boot Select) and hold
* Power-up the board
* Release the middle button (Boot Select) after system starts to boot.
* The board will automatically boot into Linux from the SD card


=== SoloCustomBoard ===
=== UBI File System ===
Booting your system requires switching the relevant DIP switch to "Boot from MMC". See picture below.
This is the FS we use on our NAND flash.<br>
[[File:Solo_boot.jpg|thumb|none|upright=2.0]]
UBIFS is very different to any traditional file system - it does not work on top of block devices (like hard drives, MMC/SD cards, USB flash drives, SSDs, etc).<br>
 
UBIFS was designed to work on top of raw flash.<br><br>
To boot board with SD card, Follow the steps below:<br>
The usage is a little different than using FAT/ext.<br>
 
Before you can access the UBIFS you need to mount it first:
*Power-off the board.
<pre>
*Insert the SD card into the SD/MMC slot of the carrier board (DVK)
=> ubi part rootfs
*Switch the relevant DIP switch to "Boot from MMC"
=> ubifsmount ubi0:rootfs
*Power-up board
</pre>
*The board will automatically boot into Linux from SD card
Now you can access the UBIFS with the regular commands above.<br>
 
The <interface> in this case is 'ubi', <dev> can be anything (the value is ignored) and part is not necessary.<br>
=== DT6CustomBoard ===
For example:
Booting your system requires switching the relevant DIP switch to "Boot from SD card". See picture below.
<pre>
[[File:Dart_boot.jpg|thumb|none|upright=2.0]]
List files in directory /home/root on the mounted UBI file system:
 
=> ls ubi 0 /home/root
To boot board with SD card, Follow the steps below:<br>
</pre>
When finished accessing it, unmount the FS:
<pre>
=> ubifsumount
</pre><br>


*Power-off the board.
== USB sub-system ==
*Insert the SD card into the SD/MMC slot of the carrier board (DVK)
To use the USB as host (connect a USB Storage or Ethernet Device to the board), you need to use the usb command.<br>
*Switch the relevant DIP switch to "Boot from SD card"
Usage:
*Power-up board
*The board will automatically boot into Linux from SD card
<section end=VAR-SOM-MX6_BOOT_BOARD/>
 
= DART-6UL=
 
== Build Results ==
<section begin=DART-6UL_BUILD_RESULTS/>
{| class="wikitable"
|-
! scope="col" | File Name
! scope="col" | Description
|-
| style="padding: 5px;"| zImage-imx6ul-var-dart-emmc_wifi.dtb
| style="padding: 5px;"| Device tree blob for DART-6UL with eMMC & WI-FI enabled. (SD card & NAND disabled)
|-
| style="padding: 5px;"| zImage-imx6ul-var-dart-nand_wifi.dtb
| style="padding: 5px;"| Device tree blob for DART-6UL with NAND flash & WI-FI enabled. (SD card & eMMC disabled)
|-
| style="padding: 5px;"| zImage-imx6ul-var-dart-sd_emmc.dtb
| style="padding: 5px;"| Device tree blob for DART-6UL with SD card & eMMC enabled (WIFI & NAND disabled)
|-
| style="padding: 5px;"| zImage-imx6ul-var-dart-sd_nand.dtb
| style="padding: 5px;"| Device tree blob for DART-6UL with SD card & NAND flash enabled (WIFI & eMMC disabled)
|-
| style="padding: 5px;"| zImage-imx6ull-var-dart-emmc_wifi.dtb
| style="padding: 5px;"| Device tree blob for DART-6ULL with eMMC & WI-FI enabled. (SD card & NAND disabled)
|-
| style="padding: 5px;"| zImage-imx6ull-var-dart-nand_wifi.dtb
| style="padding: 5px;"| Device tree blob for DART-6ULL with NAND flash & WI-FI enabled. (SD card & eMMC disabled)
|-
| style="padding: 5px;"| zImage-imx6ull-var-dart-sd_emmc.dtb
| style="padding: 5px;"| Device tree blob for DART-6ULL with SD card & eMMC enabled (WIFI & NAND disabled)
|-
| style="padding: 5px;"| zImage-imx6ull-var-dart-sd_nand.dtb
| style="padding: 5px;"| Device tree blob for DART-6ULL with SD card & NAND flash enabled (WIFI & eMMC disabled)
|-
|}
<section end=DART-6UL_BUILD_RESULTS/>
 
== Device tree ==
<section begin=DART-6UL_DTB/>
<pre>
<pre>
Build only the device tree for DART-6UL with eMMC and WiFi:
usb start - start (scan) USB controller
$ make -j4 imx6ul-var-dart-emmc_wifi.dtb
usb reset - reset (rescan) USB controller
 
usb stop [f] - stop USB [f]=force stop
Build only the device tree for DART-6UL with eMMC and SD card:
usb tree - show USB device tree
$ make -j4 imx6ul-var-dart-sd_emmc.dtb
usb info [dev] - show available USB devices
 
usb test [dev] [port] [mode] - set USB 2.0 test mode
Build only the device tree for DART-6UL with NAND flash and WiFi:
    (specify port 0 to indicate the device's upstream port)
$ make -j4 imx6ul-var-dart-nand_wifi.dtb
    Available modes: J, K, S[E0_NAK], P[acket], F[orce_Enable]
 
usb storage - show details of USB storage devices
Build only the device tree for DART-6UL with NAND flash and SD card:
usb dev [dev] - show or set current USB storage device
$ make -j4 imx6ul-var-dart-sd_nand.dtb
usb part [dev] - print partition table of one or all USB storage    devices
 
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
Build only the device tree for DART-6ULL with eMMC and WiFi:
    to memory address `addr'
$ make -j4 imx6ull-var-dart-emmc_wifi.dtb
usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'
 
    from memory address `addr'
Build only the device tree for DART-6ULL with eMMC and SD card:
$ make -j4 imx6ull-var-dart-sd_emmc.dtb
 
Build only the device tree for DART-6ULL with NAND flash and WiFi:
$ make -j4 imx6ull-var-dart-nand_wifi.dtb
 
Build only the device tree for DART-6ULL with NAND flash and SD card:
$ make -j4 imx6ull-var-dart-sd_nand.dtb
</pre>
</pre>
<section end=DART-6UL_DTB/>
First, connect your device to a USB port on the board.<br>
 
After the device is connected, start the USB controller:
== SD card image file tree ==
<section begin=DART-6UL_SD_TREE/>
<pre>
<pre>
/opt/images/
=> usb start
└── Yocto
    ├── imx6ul-var-dart-emmc_wifi.dtb
    ├── imx6ul-var-dart-nand_wifi.dtb
    ├── imx6ul-var-dart-sd_emmc.dtb
    ├── imx6ul-var-dart-sd_nand.dtb
    ├── imx6ull-var-dart-emmc_wifi.dtb
    ├── imx6ull-var-dart-nand_wifi.dtb
    ├── imx6ull-var-dart-sd_emmc.dtb
    ├── imx6ull-var-dart-sd_nand.dtb
    ├── rootfs.tar.bz2
    ├── rootfs.ubi
    ├── SPL-nand
    ├── SPL-sd
    ├── u-boot.img-nand
    ├── u-boot.img-sd
    └── zImage
</pre>
</pre>
<section end=DART-6UL_SD_TREE/>
If you connect/disconnect devices after that, before you can access them you need to rescan the USB controller:
<pre>
=> usb reset
</pre><br>


== Flash Recovery SD from GUI ==
Known Issue:<br>
<section begin=DART-6UL_FLASH_SD_FROM_GUI/>
USB Host mode on the OTG port sometimes doesn't work.<br>
[[File:DART-6UL_Recovery.png]]
To fix this, you need to disable the D-Cache by adding the following definition to <span style="font-family:Consolas;">include/configs/mx6var_som.h</span> in the U-Boot source code:<br>
<br><br>
CONFIG_SYS_DCACHE_OFF<br><br>
Touch/Click on the appropriate icon:
* Install Yocto NAND, WiFi: Flash Yocto with WiFi support to NAND flash
* Install Yocto NAND, SD card: Flash Yocto with SD card support to NAND flash
* Install Yocto eMMC (SD/WiFi) : Flash Yocto to eMMC (installs both SD card and WiFi dtbs to the BOOT partition and let U-Boot select between them at boot time)
<section end=DART-6UL_FLASH_SD_FROM_GUI/>


== Setting the Boot Mode ==
=== Using a USB Storage Device ===
<section begin=DART-6UL_BOOT_BOARD/>
Once you connected the device and stated the USB controller, you can now use the regular File System commands mentioned [[U-Boot_features#File System access|above]] with it.<br>
Booting your system from an SD card requires switching the Boot DIP switches. See picture below.
The <interface> in this case is 'usb'.<br><br>
[[File:Boot_switch_6ul1.jpg|thumb|none|upright=2.0]]
* "00" The current position in the picture will set the system to boot from SD card.
* "01" Moving the right switch will set the system to boot from eMMC
* "10" Moving the left switch will set the system to boot from NAND flash
* "11" is illegal.
{{Note|Be aware that your system has eMMC or NAND but never both.}}
<section end=DART-6UL_BOOT_BOARD/>


== Automatic device Tree selection in U-Boot ==
= Flashing NAND using U-Boot =
<section begin=DART-6UL_U-BOOT_DT_SELECTION/>
== Flashing U-Boot to NAND ==
Upon reset you will see the U-Boot SPL printouts. It will print also the SOM configuration:
Assuming you are reading the U-Boot image from our Recovery SD card:
<br>On-SOM storage: SD only, eMMC, NAND.
<br>WIFI if chip exits.
<br>For example:
<pre>
<pre>
U-Boot SPL 2015.10-00532-g482dc88 (Jan 03 2016 - 10:05:42)
=> mw.b 0x83100000 0xff 0x200000                                # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size
i.MX6UL SOC
=> load mmc 0:2 0x83100000 /opt/images/Yocto/u-boot.img          # Load the U-Boot image from the SD card to RAM
Part number: DART-6U-A01
=> nand erase 0x200000 0x200000                                  # Erase the part of the NAND saved for the U-Boot image
Assembly: AS11
=> nand write 0x83100000 0x200000 0x200000                      # Write the U-Boot image from RAM to NAND
Date of production: 2015 Dec 31
</pre><br>
DART-6UL configuration: eMMC WIFI
Ram size: 512
Boot Device: SD
</pre>
As explained in the above [[#Build_Results | Build Results]] table we have 4 optional configurations.
<br>We implemented in U-Boot and automatic device tree selection, so when kernel boots, the U-Boot will load the corresponding device tree according to On-SOM configuration.


{| class="wikitable"
== Flashing the Linux kernel to NAND ==
|-
Assuming you are reading the kernel image from our Recovery SD card:
! scope="col" | SOM Type<br/>
<pre>
! scope="col" | Boot From<br/>
=> mw.b 0x83100000 0xff 0x7e0000                                # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size
! scope="col" | SOM Internal FLASH<br/>
=> load mmc 0:2 0x83100000 /opt/images/Yocto/zImage              # Load the Linux kernel image from the SD card to RAM
! scope="col" | SOM has WIFI/BT<br/>
=> nand erase 0x600000 0x7e0000                                  # Erase the 'kernel' MTD partition
! scope="col" | Device Tree selected<br/>
=> nand write 0x83100000 0x600000 0x7e0000                      # Write the Linux kernel image from RAM to MTD partition 'kernel'
|-
</pre><br>
| DART-6UL
| SD
| eMMC
| Don't Care
| imx6ul-var-dart-sd_emmc.dtb
|-
| DART-6UL
| SD
| NAND
| Don't Care
| imx6ul-var-dart-sd_nand.dtb
|-
| DART-6UL
| eMMC
| eMMC
| Yes
| imx6ul-var-dart-emmc_wifi.dtb
|-
| DART-6UL
| eMMC
| eMMC
| NO
| imx6ul-var-dart-sd_emmc.dtb
|-
| DART-6UL
| NAND
| NAND
| YES
| imx6ul-var-dart-nand_wifi.dtb
|-
| DART-6UL
| NAND
| NAND
| NO
| imx6ul-var-dart-sd_nand.dtb
|-
| DART-6ULL
| SD
| eMMC
| Don't Care
| imx6ull-var-dart-sd_emmc.dtb
|-
| DART-6ULL
| SD
| NAND
| Don't Care
| imx6ull-var-dart-sd_nand.dtb
|-
| DART-6ULL
| eMMC
| eMMC
| Yes
| imx6ull-var-dart-emmc_wifi.dtb
|-
| DART-6ULL
| eMMC
| eMMC
| NO
| imx6ull-var-dart-sd_emmc.dtb
|-
| DART-6ULL
| NAND
| NAND
| YES
| imx6ull-var-dart-nand_wifi.dtb
|-
| DART-6ULL
| NAND
| NAND
| NO
| imx6ull-var-dart-sd_nand.dtb
|}
 
<span style="color:red">Note: Boot from SD card eliminates Wifi</span> as the Wifi and SD card are using same SDIO interface.<br>
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND to have Wi-Fi operational.
<section end=DART-6UL_U-BOOT_DT_SELECTION/>


= VAR-SOM-MX7=
== Flashing the Linux device tree to NAND ==
== Build Results ==
Assuming you are reading the .dtb file from our Recovery SD card:
<section begin=VAR-SOM-MX7_BUILD_RESULTS/>
{| class="wikitable"
|-
| style="padding: 5px;"| zImage-imx7d-var-som-emmc.dtb
| style="padding: 5px;"| Device tree blob for SOMs with eMMC.
|-
| style="padding: 5px;"| zImage-imx7d-var-som-nand.dtb
| style="padding: 5px;"| Device tree blob for SOMs with NAND flash.
|-
|}
<section end=VAR-SOM-MX7_BUILD_RESULTS/>
 
== Device tree ==
<section begin=VAR-SOM-MX7_DTB/>
<pre>
<pre>
Build only the device tree for VAR-SOM-MX7 with eMMC:
=> mw.b 0x83100000 0xff 0x20000                                          # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size (128KiB)
$ make -j4 imx7d-var-som-emmc.dtb
=> load mmc 0:2 0x83100000 /opt/images/Yocto/imx6ul-var-dart-sd_nand.dtb # Load the dtb from the SD card to RAM (choose your desired dtb file)
=> nand erase 0xde0000 0x20000                                            # Erase the part of the NAND saved for the device tree
=> nand write 0x83100000 0xde0000 0x20000                                # Write the device tree from RAM to NAND
</pre><br>


Build only the device tree for VAR-SOM-MX7 with NAND flash:
== Flashing UBIFS to NAND ==
$ make -j4 imx7d-var-som-nand.dtb
The best way to flash a UBI image is by using ubiformat (which is a part of mtd-utils) under Linux, as it preserves erase counters (our Recovery SD card scripts are using ubiformat).<br>
</pre>
But if you flash the UBIFS for the first time, then it doesn't matter because there are no erase counters to preserve.<br><br>
<section end=VAR-SOM-MX7_DTB/>


== SD card image file tree ==
Assuming you are reading the UBI image from our Recovery SD card:
<section begin=VAR-SOM-MX7_SD_TREE/>
<pre>
<pre>
/opt/images/
=> load mmc 0:2 0x83100000 /opt/images/Yocto/rootfs.ubi          # Load the UBI image from the SD card to RAM
└── Yocto
=> nand erase.part rootfs                                       # Erase the 'rootfs' MTD partition
    ├── imx7d-var-som-emmc.dtb
=> nand write.trimffs 0x83100000 rootfs $filesize                # Write the UBI image from RAM to MTD partition 'rootfs'
    ├── imx7d-var-som-nand.dtb
</pre><br>
    ├── rootfs.tar.bz2
    ├── rootfs.ubi
    ├── u-boot.imx-nand
    ├── u-boot.imx-sd
    └── zImage
</pre>
<section end=VAR-SOM-MX7_SD_TREE/>
 
== Flash Recovery SD from GUI ==
<section begin=VAR-SOM-MX7_FLASH_SD_FROM_GUI/>
[[File:VAR-SOM-MX7_Recovery.png]]
<br><br>
Touch/Click on the appropriate icon:
* Install Yocto NAND flash: Flash Yocto to NAND flash
* Install Yocto eMMC: Flash Yocto to eMMC
<section end=VAR-SOM-MX7_FLASH_SD_FROM_GUI/>


== Setting the Boot Mode ==
Note:<br>
<section begin=VAR-SOM-MX7_BOOT_BOARD/>
There is another method to do this using U-Boot, that preserves erase counters, using the higher level ubi command, but you need a UBIFS image for it (which Yocto also creates, but we do not put on our Recovery SD card by default):
Make sure the BOOT SELECT DIP switches on the carrier board are set correctly before you power on the board.
<pre>
<pre>
SW1-SW2
=> load mmc 0:2 0x83100000 /opt/images/Yocto/rootfs.ubifs        # Load the UBIFS image from an SD card to RAM
0 - 0 : Boot from SD card
=> ubi part rootfs                                              # Set current MTD partition to 'rootfs'
1 - 0 : Boot from eMMC
=> ubi remove rootfs                                            # Remove the 'rootfs' UBI volume (if already exists)
0 - 1 : Boot from NAND flash
=> ubi create rootfs                                            # Create a new dynamic UBI volume (read/write) with max size, and name it 'rootfs'
1 - 1 : Illegal
=> ubi write 0x83100000 rootfs $filesize                        # Write the volume from RAM
</pre>
</pre>
{{Note|The VAR-SOM-MX7 SOM comes with either NAND or eMMC, but not both.}}
<section end=VAR-SOM-MX7_BOOT_BOARD/>
=Platform Customizations=
== VAR-SOM-MX6 ==
<section begin=RELEASE_MORTY_BETA_VAR-SOM-MX6/>
{{#vardefine:HARDWARE_NAME|VAR-SOM-MX6}} <!--
-->{{#vardefine:RELEASE_NAME|morty-fslc-4.1.15-mx6-v1.0-beta}}  <!--
-->{{#vardefine:RELEASE_LINK|RELEASE_MORTY_BETA_VAR-SOM-MX6}}  <!--
-->{{#vardefine:RELEASE_NOTES_LINK|https://docs.google.com/spreadsheets/d/1WN-kGn3r9mcJh0EdSE3wZNBmhw5g5A95facy6gSIFn4/pubhtml}}  <!--
-->{{#vardefine:YOCTO_NAME|Morty}}  <!--
-->{{#vardefine:YOCTO_VERSION|2.2.1}}  <!--
-->{{#vardefine:FSLC_BSP_VERSION|2.2}}  <!--
-->{{#vardefine:FSL_BSP_VERSION|L4.1.15_2.0.0-ga}}  <!--
-->{{#vardefine:GSTREAMER_SUPPORT|yes}}  <!-- This parameter enables support for GSTREMAER
-->{{#vardefine:TOOLCHAIN_INSTALL_X11_NAME|fslc-x11-glibc-x86_64-meta-toolchain-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_INSTALL_QT5_NAME|fslc-x11-glibc-x86_64-meta-toolchain-qt5-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_ROOT_LOCATION|/opt/fsl-imx-x11/4.1.15-2.0.1}}  <!--
-->{{#vardefine:TOOLCHAIN_LOCATION|{{#var:TOOLCHAIN_ROOT_LOCATION}}/environment-setup-cortexa7hf-neon-poky-linux-gnueabi}}  <!--
-->{{#vardefine:BUILD_FOLDER|~/var-fslc-yocto}}  <!--
-->{{#vardefine:BUILD_FOLDER_ABSOLUTE_PATH|/home/<uname>/var-fslc-yocto}}  <!--
-->{{#vardefine:BUILD_DISTRO|fslc-x11}}  <!--
-->{{#vardefine:BUILD_DISTRO_FB|fslc-framebuffer}}  <!--
-->{{#vardefine:BUILD_FOLDER_FB|build_fb}} <!--
-->{{#vardefine:BUILD_SCRIPT|. setup-environment}} <!--
-->{{#vardefine:BUILD_FOLDER_X11|build_x11}} <!--
-->{{#vardefine:MACHINE_NAME|var-som-mx6}} <!--
-->{{#vardefine:KERNEL_GIT|https://github.com/varigit/linux-2.6-imx.git}} <!--
-->{{#vardefine:KERNEL_BRANCH|imx-rel_imx_4.1.15_2.0.0_ga-var02}} <!--
-->{{#vardefine:KERNEL_IMAGE|uImage}} <!--
-->{{#vardefine:KERNEL_DEFCONFIG|imx_v7_var_defconfig}} <!--
-->{{#vardefine:U-BOOT_GIT|https://github.com/varigit/uboot-imx.git}} <!--
-->{{#vardefine:U-BOOT_BRANCH|imx_v2015.04_4.1.15_1.1.0_ga_var01}} <!--
-->{{#vardefine:U-BOOT_SD_DEFCONFIG|mx6var_som_sd_defconfig}} <!--
-->{{#vardefine:U-BOOT_NAND_DEFCONFIG|mx6var_som_nand_defconfig}} <!--
-->{{#vardefine:U-BOOT_SD_IMAGE_NAME|u-boot.img-sd}} <!--
-->{{#vardefine:U-BOOT_NAND_IMAGE_NAME|u-boot.img-nand}} <!--
-->{{#vardefine:SPL_SD_IMAGE_NAME|SPL-sd}} <!--
-->{{#vardefine:SPL_NAND_IMAGE_NAME|SPL-nand}} <!--
-->{{#vardefine:RECOVERY_SD_NAME|{{#var:RELEASE_NAME}}.img.gz}} <!--
-->{{#vardefine:RECOVERY_SD_URL|ftp://customerv:Variscite1@ftp.variscite.com/VAR-SOM-MX6/Software/fslc}} <!--
-->{{#vardefine:KERNEL_DTB_SECTION|VAR-SOM-MX6_DTB}} <!--
-->{{#vardefine:SD_TREE_SECTION|VAR-SOM-MX6_SD_TREE}} <!--
-->{{#vardefine:YOCTO_GIT|https://github.com/varigit/variscite-bsp-platform.git}} <!--
-->{{#vardefine:YOCTO_BUILD_RESULTS_SECTION|VAR-SOM-MX6_BUILD_RESULTS}} <!--
-->{{#vardefine:YOCTO_BOOT_BOARD_SECTION|VAR-SOM-MX6_BOOT_BOARD}} <!--
-->{{#vardefine:YOCTO_FLASH_SD_FROM_GUI_SECTION|VAR-SOM-MX6_FLASH_SD_FROM_GUI}} <!--
-->{{#vardefine:EMMC_FAT_PARTITION_NAME|BOOT-VARMX6}} <!--
-->{{#vardefine:EMMC_ROOTFS_DEV|mmcblk0}} <!--
-->{{#vardefine:EMMC_ROOTFS_PARTITION_NUM|p1}} <!--
-->{{#vardefine:NAND_ROOTFS_DEV|mtd3}} <!--
-->{{#vardefine:QT_PLATFORM_PLUGIN|eglfs}} <!--
-->{{#vardefine:RAM_LOAD_ADDRESS|0x18100000}} <!--
-->{{#vardefine:YOCTO_BRANCH|morty}} <section end=RELEASE_MORTY_BETA_VAR-SOM-MX6/>
*RELEASE_NAME = '''{{#var:RELEASE_NAME}}'''
*RELEASE_LINK = '''{{#var:RELEASE_LINK}}'''
*YOCTO_NAME = '''{{#var:YOCTO_NAME}}'''
*YOCTO_VERSION = '''{{#var:YOCTO_VERSION}}'''
*FSLC_BSP_VERSION = '''{{#var:FSLC_BSP_VERSION}}'''
*FSL_BSP_VERSION = '''{{#var:FSL_BSP_VERSION}}'''
*RECOVERY_SD_NAME = '''{{#var:RECOVERY_SD_NAME}}'''
*RECOVERY_SD_URL = '''{{#var:RECOVERY_SD_URL}}'''
*RELEASE_NOTES_LINK = '''{{#var:RELEASE_NOTES_LINK}}'''
*MACHINE_NAME = '''{{#var:MACHINE_NAME}}'''
*KERNEL_GIT = '''{{#var:KERNEL_GIT}}'''
*KERNEL_BRANCH = '''{{#var:KERNEL_BRANCH}}'''
*KERNEL_IMAGE = '''{{#var:KERNEL_IMAGE}}'''
*KERNEL_DEFCONFIG = '''{{#var:KERNEL_DEFCONFIG}}'''
*U-BOOT_GIT = '''{{#var:U-BOOT_GIT}}'''
*U-BOOT_BRANCH = '''{{#var:U-BOOT_BRANCH}}'''
*U-BOOT_SD_DEFCONFIG = '''{{#var:U-BOOT_SD_DEFCONFIG}}'''
*U-BOOT_NAND_DEFCONFIG = '''{{#var:U-BOOT_NAND_DEFCONFIG}}'''
*U-BOOT_SD_IMAGE_NAME = '''{{#var:U-BOOT_SD_IMAGE_NAME}}'''
*U-BOOT_NAND_IMAGE_NAME = '''{{#var:U-BOOT_NAND_IMAGE_NAME}}'''
*SPL_SD_IMAGE_NAME = '''{{#var:SPL_SD_IMAGE_NAME}}'''
*SPL_NAND_IMAGE_NAME = '''{{#var:SPL_NAND_IMAGE_NAME}}'''
*YOCTO_GIT = '''{{#var:YOCTO_GIT}}'''
*YOCTO_META_GIT = '''{{#var:YOCTO_META_GIT}}'''
*YOCTO_BRANCH = '''{{#var:YOCTO_BRANCH}}'''
*YOCTO_BUILD_RESULTS_SECTION = '''{{#var:YOCTO_BUILD_RESULTS_SECTION}}'''
*YOCTO_BOOT_BOARD_SECTION = '''{{#var:YOCTO_BOOT_BOARD_SECTION}}'''
*KERNEL_DTB_SECTION = '''{{#var:KERNEL_DTB_SECTION}}'''
*SD_TREE_SECTION = '''{{#var:SD_TREE_SECTION}}'''
*YOCTO_FLASH_SD_FROM_GUI_SECTION = '''{{#var:YOCTO_FLASH_SD_FROM_GUI_SECTION}}'''
*EMMC_FAT_PARTITION_NAME = '''{{#var:EMMC_FAT_PARTITION_NAME}}'''
*EMMC_ROOTFS_DEV = '''{{#var:EMMC_ROOTFS_DEV}}'''
*EMMC_ROOTFS_PARTITION_NUM = '''{{#var:EMMC_ROOTFS_PARTITION_NUM}}'''
*NAND_ROOTFS_DEV = '''{{#var:NAND_ROOTFS_DEV}}'''
*QT_PLATFORM_PLUGIN = '''{{#var:QT_PLATFORM_PLUGIN}}'''
*RAM_LOAD_ADDRESS = '''{{#RAM_LOAD_ADDRESS}}'''
== DART-6UL ==
<section begin=RELEASE_MORTY_BETA_DART-6UL/> {{#vardefine:HARDWARE_NAME|DART-6UL}} <!--
-->{{#vardefine:RELEASE_NAME|morty-fslc-4.1.15-mx6ul-v1.0-beta}}  <!--
-->{{#vardefine:RELEASE_LINK|RELEASE_MORTY_BETA_DART-6UL}}  <!--
-->{{#vardefine:RELEASE_NOTES_LINK|https://docs.google.com/spreadsheets/d/1SznePOwPHdnxkbqpmP_1u6v6gXSceIHrRVPLFPB7qHE/pubhtml}}  <!--
-->{{#vardefine:YOCTO_NAME|Morty}}  <!--
-->{{#vardefine:YOCTO_VERSION|2.2.1}}  <!--
-->{{#vardefine:FSLC_BSP_VERSION|2.2}}  <!--
-->{{#vardefine:FSL_BSP_VERSION|L4.1.15_2.0.0-ga}}  <!--
-->{{#vardefine:TOOLCHAIN_INSTALL_X11_NAME|fslc-x11-glibc-x86_64-meta-toolchain-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_INSTALL_QT5_NAME|fslc-x11-glibc-x86_64-meta-toolchain-qt5-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_ROOT_LOCATION|/opt/fsl-imx-x11/4.1.15-2.0.1}}  <!--
-->{{#vardefine:TOOLCHAIN_LOCATION|{{#var:TOOLCHAIN_ROOT_LOCATION}}/environment-setup-cortexa7hf-neon-poky-linux-gnueabi}}  <!--
-->{{#vardefine:BUILD_FOLDER|~/var-fslc-yocto}}  <!--
-->{{#vardefine:BUILD_FOLDER_ABSOLUTE_PATH|/home/<uname>/var-fslc-yocto}}  <!--
-->{{#vardefine:BUILD_DISTRO|fslc-x11}}  <!--
-->{{#vardefine:BUILD_DISTRO_FB|fslc-framebuffer}}  <!--
-->{{#vardefine:BUILD_FOLDER_FB|build_fb}} <!--
-->{{#vardefine:BUILD_SCRIPT|. setup-environment}} <!--
-->{{#vardefine:BUILD_FOLDER_X11|build_x11}} <!--
-->{{#vardefine:MACHINE_NAME|imx6ul-var-dart}} <!--
-->{{#vardefine:KERNEL_GIT|https://github.com/varigit/linux-2.6-imx.git}} <!--
-->{{#vardefine:KERNEL_BRANCH|imx-rel_imx_4.1.15_2.0.0_ga-var02}} <!--
-->{{#vardefine:KERNEL_IMAGE|zImage}} <!--
-->{{#vardefine:KERNEL_DEFCONFIG|imx6ul-var-dart_defconfig}} <!--
-->{{#vardefine:U-BOOT_GIT|https://github.com/varigit/uboot-imx.git}} <!--
-->{{#vardefine:U-BOOT_BRANCH|imx_v2015.10_dart_6ul_var1}} <!--
-->{{#vardefine:U-BOOT_SD_DEFCONFIG|mx6ul_var_dart_mmc_defconfig}} <!--
-->{{#vardefine:U-BOOT_NAND_DEFCONFIG|mx6ul_var_dart_nand_defconfig}} <!--
-->{{#vardefine:U-BOOT_SD_IMAGE_NAME|u-boot.img-sd}} <!--
-->{{#vardefine:U-BOOT_NAND_IMAGE_NAME|u-boot.img-nand}} <!--
-->{{#vardefine:SPL_SD_IMAGE_NAME|SPL-sd}} <!--
-->{{#vardefine:SPL_NAND_IMAGE_NAME|SPL-nand}} <!--
-->{{#vardefine:RECOVERY_SD_NAME|{{#var:RELEASE_NAME}}.img.gz}} <!--
-->{{#vardefine:RECOVERY_SD_URL|ftp://customerv:Variscite1@ftp.variscite.com/DART-6UL/Software/fslc}} <!--
-->{{#vardefine:KERNEL_DTB_SECTION|DART-6UL_DTB}} <!--
-->{{#vardefine:SD_TREE_SECTION|DART-6UL_SD_TREE}} <!--
-->{{#vardefine:YOCTO_GIT|https://github.com/varigit/variscite-bsp-platform.git}} <!--
-->{{#vardefine:YOCTO_BUILD_RESULTS_SECTION|DART-6UL_BUILD_RESULTS}} <!--
-->{{#vardefine:YOCTO_BOOT_BOARD_SECTION|DART-6UL_BOOT_BOARD}} <!--
-->{{#vardefine:YOCTO_FLASH_SD_FROM_GUI_SECTION|DART-6UL_FLASH_SD_FROM_GUI}} <!--
-->{{#vardefine:EMMC_FAT_PARTITION_NAME|BOOT-VAR6UL}} <!--
-->{{#vardefine:EMMC_ROOTFS_DEV|mmcblk1}} <!--
-->{{#vardefine:EMMC_ROOTFS_PARTITION_NUM|p2}} <!--
-->{{#vardefine:NAND_ROOTFS_DEV|mtd4}} <!--
-->{{#vardefine:QT_PLATFORM_PLUGIN|linuxfb}} <!--
-->{{#vardefine:RAM_LOAD_ADDRESS|0x83100000}} <!--
-->{{#vardefine:YOCTO_BRANCH|morty}} <section end=RELEASE_MORTY_BETA_DART-6UL/>
*RELEASE_NAME = '''{{#var:RELEASE_NAME}}'''
*RELEASE_LINK = '''{{#var:RELEASE_LINK}}'''
*YOCTO_NAME = '''{{#var:YOCTO_NAME}}'''
*YOCTO_VERSION = '''{{#var:YOCTO_VERSION}}'''
*FSLC_BSP_VERSION = '''{{#var:FSLC_BSP_VERSION}}'''
*FSL_BSP_VERSION = '''{{#var:FSL_BSP_VERSION}}'''
*RECOVERY_SD_NAME = '''{{#var:RECOVERY_SD_NAME}}'''
*RECOVERY_SD_URL = '''{{#var:RECOVERY_SD_URL}}'''
*RELEASE_NOTES_LINK = '''{{#var:RELEASE_NOTES_LINK}}'''
*MACHINE_NAME = '''{{#var:MACHINE_NAME}}'''
*KERNEL_GIT = '''{{#var:KERNEL_GIT}}'''
*KERNEL_BRANCH = '''{{#var:KERNEL_BRANCH}}'''
*KERNEL_IMAGE = '''{{#var:KERNEL_IMAGE}}'''
*KERNEL_DEFCONFIG = '''{{#var:KERNEL_DEFCONFIG}}'''
*U-BOOT_GIT = '''{{#var:U-BOOT_GIT}}'''
*U-BOOT_BRANCH = '''{{#var:U-BOOT_BRANCH}}'''
*U-BOOT_SD_DEFCONFIG = '''{{#var:U-BOOT_SD_DEFCONFIG}}'''
*U-BOOT_NAND_DEFCONFIG = '''{{#var:U-BOOT_NAND_DEFCONFIG}}'''
*U-BOOT_SD_IMAGE_NAME = '''{{#var:U-BOOT_SD_IMAGE_NAME}}'''
*U-BOOT_NAND_IMAGE_NAME = '''{{#var:U-BOOT_NAND_IMAGE_NAME}}'''
*SPL_SD_IMAGE_NAME = '''{{#var:SPL_SD_IMAGE_NAME}}'''
*SPL_NAND_IMAGE_NAME = '''{{#var:SPL_NAND_IMAGE_NAME}}'''
*YOCTO_GIT = '''{{#var:YOCTO_GIT}}'''
*YOCTO_META_GIT = '''{{#var:YOCTO_META_GIT}}'''
*YOCTO_BRANCH = '''{{#var:YOCTO_BRANCH}}'''
*YOCTO_BUILD_RESULTS_SECTION = '''{{#var:YOCTO_BUILD_RESULTS_SECTION}}'''
*YOCTO_BOOT_BOARD_SECTION = '''{{#var:YOCTO_BOOT_BOARD_SECTION}}'''
*KERNEL_DTB_SECTION = '''{{#var:KERNEL_DTB_SECTION}}'''
*SD_TREE_SECTION = '''{{#var:SD_TREE_SECTION}}'''
*EMMC_FAT_PARTITION_NAME = '''{{#var:EMMC_FAT_PARTITION_NAME}}'''
*EMMC_ROOTFS_DEV = '''{{#var:EMMC_ROOTFS_DEV}}'''
*EMMC_ROOTFS_PARTITION_NUM = '''{{#var:EMMC_ROOTFS_PARTITION_NUM}}'''
*NAND_ROOTFS_DEV = '''{{#var:NAND_ROOTFS_DEV}}'''
*QT_PLATFORM_PLUGIN = '''{{#var:QT_PLATFORM_PLUGIN}}'''
*RAM_LOAD_ADDRESS = '''{{#RAM_LOAD_ADDRESS}}'''
== VAR-SOM-MX7 ==
<section begin=RELEASE_MORTY_BETA_VAR-SOM-MX7/> {{#vardefine:HARDWARE_NAME|VAR-SOM-MX7}} <!--
-->{{#vardefine:RELEASE_NAME|morty-fslc-4.1.15-mx7-v1.0-beta}}  <!--
-->{{#vardefine:RELEASE_LINK|RELEASE_MORTY_BETA_VAR-SOM-MX7}}  <!--
-->{{#vardefine:RELEASE_NOTES_LINK|https://docs.google.com/spreadsheets/d/1UqpIu3ztSIbsXqV52QFLjz-jhTXLfUtsX9-HQUy6tsQ/pubhtml}}  <!--
-->{{#vardefine:YOCTO_NAME|Morty}}  <!--
-->{{#vardefine:YOCTO_VERSION|2.2.1}}  <!--
-->{{#vardefine:FSLC_BSP_VERSION|2.2}}  <!--
-->{{#vardefine:FSL_BSP_VERSION|L4.1.15_2.0.0-ga}}  <!--
-->{{#vardefine:TOOLCHAIN_INSTALL_X11_NAME|fslc-x11-glibc-x86_64-meta-toolchain-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_INSTALL_QT5_NAME|fslc-x11-glibc-x86_64-meta-toolchain-qt5-armv7at2hf-neon-toolchain-2.2.1.sh}}  <!--
-->{{#vardefine:TOOLCHAIN_ROOT_LOCATION|/opt/fsl-imx-x11/4.1.15-2.0.1}}  <!--
-->{{#vardefine:TOOLCHAIN_LOCATION|{{#var:TOOLCHAIN_ROOT_LOCATION}}/environment-setup-cortexa7hf-neon-poky-linux-gnueabi}}  <!--
-->{{#vardefine:BUILD_FOLDER|~/var-fslc-yocto}}  <!--
-->{{#vardefine:BUILD_DISTRO|fslc-x11}}  <!--
-->{{#vardefine:BUILD_DISTRO_FB|fslc-framebuffer}}  <!--
-->{{#vardefine:BUILD_FOLDER_FB|build_fb}} <!--
-->{{#vardefine:BUILD_SCRIPT|. setup-environment}} <!--
-->{{#vardefine:BUILD_FOLDER_X11|build_x11}} <!--
-->{{#vardefine:MACHINE_NAME|imx7-var-som}} <!--
-->{{#vardefine:KERNEL_GIT|https://github.com/varigit/linux-2.6-imx.git}} <!--
-->{{#vardefine:KERNEL_BRANCH|imx-rel_imx_4.1.15_2.0.0_ga-var02}} <!--
-->{{#vardefine:KERNEL_IMAGE|zImage}} <!--
-->{{#vardefine:KERNEL_DEFCONFIG|imx7-var-som_defconfig}} <!--
-->{{#vardefine:U-BOOT_GIT|https://github.com/varigit/uboot-imx.git}} <!--
-->{{#vardefine:U-BOOT_BRANCH|imx_v2015.04_4.1.15_1.1.0_ga_var02}} <!--
-->{{#vardefine:U-BOOT_SD_DEFCONFIG|mx7dvar_som_defconfig}} <!--
-->{{#vardefine:U-BOOT_NAND_DEFCONFIG|mx7dvar_som_nand_defconfig}} <!--
-->{{#vardefine:U-BOOT_SD_IMAGE_NAME|u-boot.imx-sd}} <!--
-->{{#vardefine:U-BOOT_NAND_IMAGE_NAME|u-boot.imx-nand}} <!--
-->{{#vardefine:RECOVERY_SD_NAME|{{#var:RELEASE_NAME}}.img.gz}} <!--
-->{{#vardefine:RECOVERY_SD_URL|ftp://customerv:Variscite1@ftp.variscite.com/VAR-SOM-MX7/Software/fslc}} <!--
-->{{#vardefine:KERNEL_DTB_SECTION|VAR-SOM-MX7_DTB}} <!--
-->{{#vardefine:SD_TREE_SECTION|VAR-SOM-MX7_SD_TREE}} <!--
-->{{#vardefine:YOCTO_GIT|https://github.com/varigit/variscite-bsp-platform.git}} <!--
-->{{#vardefine:YOCTO_BUILD_RESULTS_SECTION|VAR-SOM-MX7_BUILD_RESULTS}} <!--
-->{{#vardefine:YOCTO_BOOT_BOARD_SECTION|VAR-SOM-MX7_BOOT_BOARD}} <!--
-->{{#vardefine:YOCTO_FLASH_SD_FROM_GUI_SECTION|VAR-SOM-MX7_FLASH_SD_FROM_GUI}} <!--
-->{{#vardefine:EMMC_FAT_PARTITION_NAME|BOOT-VARMX7}} <!--
-->{{#vardefine:EMMC_ROOTFS_DEV|mmcblk2}} <!--
-->{{#vardefine:EMMC_ROOTFS_PARTITION_NUM|p2}} <!--
-->{{#vardefine:NAND_ROOTFS_DEV|mtd4}} <!--
-->{{#vardefine:READ_ONLY_ROOTFS|yes}} <!--
-->{{#vardefine:QT_PLATFORM_PLUGIN|linuxfb}} <!--
-->{{#vardefine:RAM_LOAD_ADDRESS|0x83100000}} <!--
-->{{#vardefine:YOCTO_BRANCH|morty}} <section end=RELEASE_MORTY_BETA_VAR-SOM-MX7/>
*RELEASE_NAME = '''{{#var:RELEASE_NAME}}'''
*RELEASE_LINK = '''{{#var:RELEASE_LINK}}'''
*YOCTO_NAME = '''{{#var:YOCTO_NAME}}'''
*YOCTO_VERSION = '''{{#var:YOCTO_VERSION}}'''
*FSLC_BSP_VERSION = '''{{#var:FSLC_BSP_VERSION}}'''
*FSL_BSP_VERSION = '''{{#var:FSL_BSP_VERSION}}'''
*RECOVERY_SD_NAME = '''{{#var:RECOVERY_SD_NAME}}'''
*RECOVERY_SD_URL = '''{{#var:RECOVERY_SD_URL}}'''
*RELEASE_NOTES_LINK = '''{{#var:RELEASE_NOTES_LINK}}'''
*MACHINE_NAME = '''{{#var:MACHINE_NAME}}'''
*KERNEL_GIT = '''{{#var:KERNEL_GIT}}'''
*KERNEL_BRANCH = '''{{#var:KERNEL_BRANCH}}'''
*KERNEL_IMAGE = '''{{#var:KERNEL_IMAGE}}'''
*KERNEL_DEFCONFIG = '''{{#var:KERNEL_DEFCONFIG}}'''
*U-BOOT_GIT = '''{{#var:U-BOOT_GIT}}'''
*U-BOOT_BRANCH = '''{{#var:U-BOOT_BRANCH}}'''
*U-BOOT_SD_DEFCONFIG = '''{{#var:U-BOOT_SD_DEFCONFIG}}'''
*U-BOOT_NAND_DEFCONFIG = '''{{#var:U-BOOT_NAND_DEFCONFIG}}'''
*U-BOOT_SD_IMAGE_NAME = '''{{#var:U-BOOT_SD_IMAGE_NAME}}'''
*U-BOOT_NAND_IMAGE_NAME = '''{{#var:U-BOOT_NAND_IMAGE_NAME}}'''
*SPL_SD_IMAGE_NAME = '''{{#var:SPL_SD_IMAGE_NAME}}'''
*SPL_NAND_IMAGE_NAME = '''{{#var:SPL_NAND_IMAGE_NAME}}'''
*YOCTO_GIT = '''{{#var:YOCTO_GIT}}'''
*YOCTO_META_GIT = '''{{#var:YOCTO_META_GIT}}'''
*YOCTO_BRANCH = '''{{#var:YOCTO_BRANCH}}'''
*YOCTO_BUILD_RESULTS_SECTION = '''{{#var:YOCTO_BUILD_RESULTS_SECTION}}'''
*YOCTO_BOOT_BOARD_SECTION = '''{{#var:YOCTO_BOOT_BOARD_SECTION}}'''
*KERNEL_DTB_SECTION = '''{{#var:KERNEL_DTB_SECTION}}'''
*SD_TREE_SECTION = '''{{#var:SD_TREE_SECTION}}'''
*YOCTO_FLASH_SD_FROM_GUI_SECTION = '''{{#var:YOCTO_FLASH_SD_FROM_GUI_SECTION}}'''
*READ_ONLY_ROOTFS = '''{{#var:yes}}'''
*EMMC_FAT_PARTITION_NAME = '''{{#var:EMMC_FAT_PARTITION_NAME}}'''
*EMMC_ROOTFS_DEV = '''{{#var:EMMC_ROOTFS_DEV}}'''
*EMMC_ROOTFS_PARTITION_NUM = '''{{#var:EMMC_ROOTFS_PARTITION_NUM}}'''
*NAND_ROOTFS_DEV = '''{{#var:NAND_ROOTFS_DEV}}'''
*QT_PLATFORM_PLUGIN = '''{{#var:QT_PLATFORM_PLUGIN}}'''
*RAM_LOAD_ADDRESS = '''{{#RAM_LOAD_ADDRESS}}'''

Revision as of 13:56, 23 May 2017

DART-6UL - U-Boot features

USB ports

In the DART-6UL U-Boot:
USB port 1 (lower type-A receptacle) is defined as USB Host.
USB port 0 (micro USB receptacle / upper type-A receptacle) is defined as USB Client.

USB Mass Storage gadget

You can use the board as a USB Mass Storage device:
You will be able to access all the partitions of any block device that is on the board or connected to it, from your host PC - You will see them as /dev/sdXX, just like connecting a regular USB storage to your PC, and you'll be able to mount them, and have full read/write access to them. You can even use it to flash a new U-Boot, re-partition the storage, re-format it, etc.
This is especially useful for updating the internal eMMC.

To do this you need to connect a USB cable between the USB Client port of the board and a regular USB Host port on your PC, and use U-Boot's ums command.

General ums usage is:

ums <USB_controller> [<devtype>] <devnum>  e.g. ums 0 mmc 0
    devtype defaults to mmc

devtype can be any block device (e.g. mmc, usb)

To mount the eMMC:

=> ums 0 mmc 1

To mount an SD card:

=> ums 0 mmc 0

Depending on your host PC, it may automatically mount it or not. If not, you can use dmesg to see the names of the device and its partitions (it should be in the form of /dev/sdXX) and mount them yourself.
To exit the ums command and disconnect the USB device press ctrl+c.

Note: You should use a Linux PC host as Windows can't naturally read ext file systems.

USB Ethernet Gadget

The USB Ethernet gadget allows you to make the board act as a USB Ethernet device when connecting its USB Client port to a host PC using a USB cable.
Basically, it allows for "Ethernet over USB".
This is especially useful if you build a custom board without an Ethernet interface and you want to boot via network using TFTP.

For this, a new Ethernet interface called usb_ether was added to U-Boot.

Before actually using it you should get to know the following environment variables:
Variables specific to this gadget:

usbnet_devaddr  - The virtual MAC address of the device (the board side) - f8:dc:7a:00:00:02 by default.
usbnet_hostaddr - The virtual MAC address of the host (the PC side) - f8:dc:7a:00:00:01 by default.

General network variables:

ethprime - Sets the primary Ethernet interface. This is the interface that will be tried first.
ethact   - Sets the currently active Ethernet interface. Normally, it is modified by the Ethernet driver, but you can change it if you want to override.
ipaddr   - IP address of the device - needed for tftp command.
netmask  - Subnet Mask.
serverip - TFTP server IP address - needed for tftp command.

So, for example:

=> setenv ethact usb_ether
=> setenv ipaddr 192.168.0.100
=> setenv netmask 255.255.255.0
=> setenv serverip 192.168.0.101

And now your are ready to use tftpboot over the usb_ether interface.

Notes:

  • Once you run a network command, e.g. tftpboot, the gadget will be connected to your host PC and a new network adapter will be added to it, for the duration of the network interaction.
  • Note that you may need to configure your host PC to use the new network adapter properly - this configuration is OS dependent.

General U-Boot commands

List all supported commands and their description/usage (help command)

List all supported commands with a brief description for each one:

=> help

Print the description and usage of 'command':

=> help command


Environment handling commands

Print the values of all environment variables:

=> printenv

Print value of environment variable 'name':

=> printenv name

Set environment variable 'name' to 'value ...':

=> setenv name value ...

Delete environment variable 'name':

=> setenv name

Reset default environment:

=> env default -a

Save environment variables to persistent storage:

=> saveenv


File System access

List files in a directory (default /):

=> ls <interface> [<dev[:part]>] [directory]

For example:

List files in the BOOT partition of our NAND/eMMC Recovery SD card (after booting from it):
=> ls mmc 0:1

List files in directory /opt/images/Yocto in the rootfs partition of our NAND/eMMC Recovery SD card (after booting from it):
=> ls mmc 0:2 /opt/images/Yocto


Load binary file 'filename' from a partition to RAM address 'addr':

=> load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]

For example:

Load /boot/splash.bmp from the rootfs partition of our NAND/eMMC Recovery SD card (after booting from it) to RAM address 0x18100000:
=> load mmc 0:2 0x18100000 /boot/splash.bmp


UBI File System

This is the FS we use on our NAND flash.
UBIFS is very different to any traditional file system - it does not work on top of block devices (like hard drives, MMC/SD cards, USB flash drives, SSDs, etc).
UBIFS was designed to work on top of raw flash.

The usage is a little different than using FAT/ext.
Before you can access the UBIFS you need to mount it first:

=> ubi part rootfs
=> ubifsmount ubi0:rootfs

Now you can access the UBIFS with the regular commands above.
The <interface> in this case is 'ubi', <dev> can be anything (the value is ignored) and part is not necessary.
For example:

List files in directory /home/root on the mounted UBI file system:
=> ls ubi 0 /home/root

When finished accessing it, unmount the FS:

=> ubifsumount


USB sub-system

To use the USB as host (connect a USB Storage or Ethernet Device to the board), you need to use the usb command.
Usage:

usb start - start (scan) USB controller
usb reset - reset (rescan) USB controller
usb stop [f] - stop USB [f]=force stop
usb tree - show USB device tree
usb info [dev] - show available USB devices
usb test [dev] [port] [mode] - set USB 2.0 test mode
    (specify port 0 to indicate the device's upstream port)
    Available modes: J, K, S[E0_NAK], P[acket], F[orce_Enable]
usb storage - show details of USB storage devices
usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage    devices
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
    to memory address `addr'
usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'
    from memory address `addr'

First, connect your device to a USB port on the board.
After the device is connected, start the USB controller:

=> usb start

If you connect/disconnect devices after that, before you can access them you need to rescan the USB controller:

=> usb reset


Known Issue:
USB Host mode on the OTG port sometimes doesn't work.
To fix this, you need to disable the D-Cache by adding the following definition to include/configs/mx6var_som.h in the U-Boot source code:
CONFIG_SYS_DCACHE_OFF

Using a USB Storage Device

Once you connected the device and stated the USB controller, you can now use the regular File System commands mentioned above with it.
The <interface> in this case is 'usb'.

Flashing NAND using U-Boot

Flashing U-Boot to NAND

Assuming you are reading the U-Boot image from our Recovery SD card:

=> mw.b 0x83100000 0xff 0x200000                                 # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size
=> load mmc 0:2 0x83100000 /opt/images/Yocto/u-boot.img          # Load the U-Boot image from the SD card to RAM
=> nand erase 0x200000 0x200000                                  # Erase the part of the NAND saved for the U-Boot image 
=> nand write 0x83100000 0x200000 0x200000                       # Write the U-Boot image from RAM to NAND


Flashing the Linux kernel to NAND

Assuming you are reading the kernel image from our Recovery SD card:

=> mw.b 0x83100000 0xff 0x7e0000                                 # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size
=> load mmc 0:2 0x83100000 /opt/images/Yocto/zImage              # Load the Linux kernel image from the SD card to RAM
=> nand erase 0x600000 0x7e0000                                  # Erase the 'kernel' MTD partition
=> nand write 0x83100000 0x600000 0x7e0000                       # Write the Linux kernel image from RAM to MTD partition 'kernel'


Flashing the Linux device tree to NAND

Assuming you are reading the .dtb file from our Recovery SD card:

=> mw.b 0x83100000 0xff 0x20000                                           # Write 0xFF to RAM in order to pad the image and align it to the NAND erase block size (128KiB)
=> load mmc 0:2 0x83100000 /opt/images/Yocto/imx6ul-var-dart-sd_nand.dtb  # Load the dtb from the SD card to RAM (choose your desired dtb file)
=> nand erase 0xde0000 0x20000                                            # Erase the part of the NAND saved for the device tree
=> nand write 0x83100000 0xde0000 0x20000                                 # Write the device tree from RAM to NAND


Flashing UBIFS to NAND

The best way to flash a UBI image is by using ubiformat (which is a part of mtd-utils) under Linux, as it preserves erase counters (our Recovery SD card scripts are using ubiformat).
But if you flash the UBIFS for the first time, then it doesn't matter because there are no erase counters to preserve.

Assuming you are reading the UBI image from our Recovery SD card:

=> load mmc 0:2 0x83100000 /opt/images/Yocto/rootfs.ubi          # Load the UBI image from the SD card to RAM
=> nand erase.part rootfs                                        # Erase the 'rootfs' MTD partition
=> nand write.trimffs 0x83100000 rootfs $filesize                # Write the UBI image from RAM to MTD partition 'rootfs'


Note:
There is another method to do this using U-Boot, that preserves erase counters, using the higher level ubi command, but you need a UBIFS image for it (which Yocto also creates, but we do not put on our Recovery SD card by default):

=> load mmc 0:2 0x83100000 /opt/images/Yocto/rootfs.ubifs        # Load the UBIFS image from an SD card to RAM
=> ubi part rootfs                                               # Set current MTD partition to 'rootfs'
=> ubi remove rootfs                                             # Remove the 'rootfs' UBI volume (if already exists)
=> ubi create rootfs                                             # Create a new dynamic UBI volume (read/write) with max size, and name it 'rootfs'
=> ubi write 0x83100000 rootfs $filesize                         # Write the volume from RAM