{{template>en:templates:tabs_yocto_bootstrap|product_type="Embedded module"|lang="en"|mod_name="tqmlx2160a"|mod_name_head="TQMLX2160A"|mod_arch="layerscape"|bsp_name="linux"|build_system="yocto"|build_system_head="YOCTO"|bsp_name_head="Linux"}}
\\
===== Deployment Yocto =====
===== BSP Binaries =====
- All binaries are intended for the usage on the STKLX2160a
- The symlinks point to the files of the last build
{{section>.:..:..:data#yocto_images&noheader}}
===== Partitions =====
{{section>.:..:..:..:partitions#tqmlx2160a&noheader}}
^ Memory Range ^ Usage ^
| 0x000000000000-0x000000100000 | RCW-PBL |
| 0x000000100000-0x000000300000 | U-Boot |
| 0x000000500000-0x000000600000 | U-Boot-Env |
| 0x000000800000-0x000000a00000 | DDR-PHY |
| 0x000000a00000-0x000000d00000 | DPAA2-MC |
| 0x000000d00000-0x000000e00000 | DPAA2-DPL |
| 0x000000e00000-0x000000f00000 | DPAA2-DPC |
| 0x000000f00000-0x000001000000 | Linux-DTB |
| 0x000001000000-0x000003000000 | Kernel |
| 0x000003000000-0x000008000000 | RootFS UBI |
===== Updating SPI Flash Devices =====
Before flashing the SPI devices on the TQMLX2160, ensure that the DIP switches are configured for SD-Card/eMMC boot mode.
Once the correct boot mode is set, use switch S1-4 (ON or OFF) to select the desired SPI device for flashing.
This switch specifically controls the NOR_SWAP# signal, which determines which SPI flash device is targeted.\\
To check whether NOR-Swap is enabled or disabled, you can take a look at the display on the MBLX2160 under the S1 information page. Depending on how S1-4 is set, the signal should be enabled/disabled.
It is important to perform a power cycle after switching S1-4 ON/OFF
For the following commands, we are using a USB storage device as an example source for loading the bootloader and PBL images into memory, but you could
also retrieve these files for example via TFTP before writing them to the SPI flash with the sf write command. Please ensure that you change the files in the < > to the names of the files you require.
$ usb start
$ sf probe
$ fatload usb 0:1 ${fileaddr}
$ sf write ${fileaddr} ${uboot_spi_offset} ${filesize}
$ fatload usb 0:1 $fileaddr
$ sf write ${fileaddr} ${pbl_spi_offset} ${filesize}
^ ^ Size ^ Uasage ^
| 0x0001 sectors 512 Byte | MBR /Partition Table |
| 0x0007 sectors 3584 Byte | Free |
| 0x1000 / | RCW-PBL |
| | U-Boot |
| | DDR-PHY |
| | Boot Partition |
| | RootFS ext4 |
----
===== Create SD Card with BSP Image =====
The Image can be simply written to the SD Card by using the dd shell command in Linux:
$ cd
$ sudo dd if=tq-image-generic.wic of=/dev/sdc bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdc
The image must be written to the RAW device of the SD Card (e.g. /dev/sdc) and not into a partition (e.g. /dev/sdc1) !
To identify the SD card in Linux the shell command dmesg can be used:
- Open a new terminal
- Execute the following command without plugged SD Card $ dmesg | tail -n 15
- Insert SD Card and wait a few seconds
- Run the command from step two again
$ dmesg | tail -n 15
#plug in SD Card into the reader
$ dmesg | tail -n 15
\\
----
===== Updating existing firmware over ethernet =====
\\
A good approach to update the firmare components U-Boot,Linux kernel and devicetree in a running system it to load them from a tftp server. \\
This process requires a running TFTP server, please see the following page [[en:general_information:tftp|how to setup TFTP Server]].
After setting up the TFTP server, the binaries to be updated must be copied into the TFTP directory.
==== Update Process ====
1. Setup the Starterkit to boot from eMMC or SD \\
2. Connect the kit to the network with TFTP server supplying the binaries via ethernet on connector depands on SerDes configuration. \\
3. Power up the system and interrupt the boot process in U-Boot\\
Hit any key to stop autoboot: 0
=>
3. Setup the ethernet interface:
++++ Set network settings manually |
Provide the correct network configuration in U-Boot:
* => setenv autoload no
* => setenv serverip (IP address of your TFTP server e.g.: setenv serverip 192.168.100.110)
* => setenv ipaddr (e.g.: setenv ipaddr 192.168.100.111)
* => setenv netmask (e.g.: setenv netmask 255.255.255.0)
++++
++++ Set network settings using DHCP |
If a DHCP server is available in the network, the interface can be configured by the server:
* => setenv autoload no
* => setenv serverip (IP address of your TFTP server e.g.: setenv serverip 192.168.100.110)
* => dhcp (get IP from server)
++++
\\
**4. Set the file name of the binary to update in U-Boot :**\\
* For U-Boot update on eMMC: => setenv uboot \\ e.g. fip_uboot.bin \\
* For U-Boot update on SD Card: => setenv uboot \\ e.g. fip_uboot.bin\\
* For U-Boot update on QSPI NOR Flash: => setenv uboot \\ e.g. fip_uboot.bin\\
\\
* For PBL update on eMMC: => setenv pbl_sdmmc \\ e.g. bl2_auto.pbl
* For PBL update on SD Card: => setenv sdmmc \\ e.g. bl2_auto.pbl
* For PBL update on QSPI NOR Flash: => setenv pbl_spi \\ e.g. bl2_flexspi_nor.pbl
\\
**5. Perform U-Boot Update by running the update command:**
* U-Boot update on eMMC: => run update_uboot_mmc
\\
* U-Boot update on SD Card: => run update_uboot_sd
\\
* U-Boot update on QSPI NOR Flash: => run update_uboot_spi
\\
**6. Perform PBL Update by running the update command:**
* PBL update on eMMC: => run update_pbl_mmc
\\
* PBL update on SD Card: => run update_pbl_sd
\\
* PBL update on QSPI NOR Flash: => run update_pbl_spi
\\
The variables can be saved with the command **saveenv** to keep the values permanently.
----
===== Copy Firmware from SD card to eMMC using U-Boot =====
* Write Image to SD card (use dd command under Linux or Win32diskImager under Windows)
The image on the SD card must not be booted, otherwise the initial run once services have already been started.
* Set Starterkit to boot from SD, please see [[en:layerscape:tqmlx2160a:mblx2160a:dip_switches|DIP Switch Settings]]
* Interrupt the boot process to get to the U-Boot prompt
* Use the following commands to copy the SD card to eMMMC
The following commands are based on the default [[.:deployment_yocto#yocto_partitions|eMMC/SD image partitioning]].
{{section>.:..:..:data#yocto_specific_command_update_emmc&noheader}}
\\
2. Save environment U-boot environment (optional):
=> saveenv
\\
3. run the following command to start the update procedure:
=> run install_firmware
----
===== Using NFS boot =====
=== Prerequisites ===
* [[en:nfs|How to setup the NFS Server on your Host Computer]]
* [[en:tftp|How to setup the TFTP Server on your Host Computer]]
To boot the @mod_name@ from network you need a working bootloader in eMMC/SD-card or SPI-NOR (placement option on @mod_name@ ) which is able to get the kernel image over tftp and to provide the kernel with commandline settings for NFS.
The dtb-file and kernel image have to be provided via tftp and the rootfs via nfs.
=== Configuration of U-Boot Environment ===
The bootloader environment needs to be modified to work with your tftp-server and your nfs-server.\\
\\
1. Prepare network interface:
++++ Set network settings manually |
Provide the correct network configuration in U-Boot:
* => setenv autoload no
* => setenv serverip (e.g.: setenv serverip 192.168.100.110)
* => setenv ipaddr (e.g.: setenv ipaddr 192.168.100.111)
* => setenv netmask (e.g.: setenv netmask 255.255.255.0)
++++
++++ Set network settings using DHCP |
If a DHCP server is available in the network, the interface can be configured by the server:
* => setenv autoload no
* => setenv serverip (e.g.: setenv serverip 192.168.100.110)
* => dhcp (get IP from server)
++++
2. set the Uboot variables for TFTP and NFS:
* setenv rootpath (NFS directory has to set in /etc/exports on the Computer that runs the NFS server first)
* setenv fdt_file (name of devicetree file to be downloaded from the tftp server)
* setenv image (name of the Linux kernel image to be downloaded from the tftp server)
3. Run the uboot script to boot from nfs:
{{section>.:..:..:data#uboot_command_to_start_netboot}}