TQMa6ULx-BSP
U-Boot
+
++++REV.0107
TQMa6ULx-BSP
* Added platform MBa6ULxL
* Updated Build system to PTXdist 2019.01
* Updated OSELAS Toolchain to 2018.02
U-Boot
* added several bugfixes
* fixed fdt_file environment variable definition
* set default i2c dev to 3 (MBa6ulxl)
* fixed typo in header include guard
* fix build without CONFIG_DM_SPI_FLASH and CONFIG_SPI_FLASH
* Added platform MBa6ULxL
Linux
* Update kernel version to NXP 4.14.78
* Set USB1 OTG dr_mode to otg
* QSPI NOR flash uses 4byte opcodes
* Changed default LVDS display to Tianma TM070JVHG33
* add cpu cooling levels
* fixed RS485 support
* Added platform MBa6ULxL
* display: use 24 LCD data pins
* set USB1 OTG dr_mode to otg
++++REV.0106
TQMa6ULx-BSP
* Support / fixes for TQMa6ULx with automotive grade CPU
* e-MMC Timing fix for TQMa6ULx / TQMa6ULxL (low temperature improvement / limit clock speed)
* Update DRAM calibration values for TQMa6ULL
* update patches for TQMa6UL / TQMa6LL e-MMC clocking fix
* update u-boot-imx for TQMa6ULL and TQMa6UL automotive support
U-Boot
* fix output of i.MX6UL(L) speed grade with 696 MHz
* added TQMa6ULL1 support
Linux
* rewrite e-MMC clocking and tuning
* apply e-MMC clocking changes also for LGA module
++++REV.0104
TQMa6ULx-BSP
* Bugfixes in upstream packages
* Splash if fbdev found
* system images for QSPI
* UBI image creation for QSPI
* Change image names (mba6ul → mba6ulx, tqma6ul → tqma6ulx)
U-Boot
* Support TQMa6ULx 030x / TQMa6ULxL 020x on MBa6ULx 020x
* Dynamic default if no devicetree set
* Optimize defconfigs
* UBI boot support
* Simplify env scripts
* Optimize qspi clock
* Optimize RAM timing
* Update base version from NXP
Linux
* Backport mmc sysfs fixes for OCR / DSR
* Optimize / cleanup e-MMC / SD config
* Improve QSPI support / Backport jedec detect for QSPI
* Allow 4-Byte address command set for QSPI
* MTD Partitions for MBa6UL
* Backport fixes for EDT Touch
* Rewrite devicetree to reuse fragments for display / TQMa6ULxL etc.
* Support more display variants
* Update base version from NXP
===== DevHost =====
===== Compilation =====
===== Adapt BSP =====
===== Deployment PTXdist =====
==== Create SD Card with BSP Image ====
To install a new firmware use SD cards. To copy the built images on the host system to a connected card type:
<code bash>
$ cd <BSP project>/platform-<platform_name>/images
$ sudo dd if=u-boot_<label mod_name_code>MOD_NAME_CODE</label>_hd.img of=/dev/sdf bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdf
</code>
To find out what device file the SD card has, type "dmesg" after you connect the card to see the system messages.
At the bottom you'll see some "Attached scsi ..." messages along with something like:
<code bash>
[ 8197.588395] sdf: sdf1
</code>
----
==== Updating existing firmware over ethernet ====
\\
To update bootloader / kernel / devicetree in a running system you have to copy the images in your tftp directory and upload them to the eMMC or SD Card.\\
Please see [[en:general_information:tftp How to setup TFTP Server]]
1. Boot from eMMC or SD and stop autoboot in U-Boot
Hit any key to stop autoboot: 0
=>
2. Set U-Boot variable mmcdev according to the drive you want to write to
=> setenv mmcdev <Nr.>
Device assignment:
mmcdev 0 = eMMC
mmcdev 1 = SD Card
3. Connect device via ethernet to a tftp server supplying the image
4. Provide the correct network configuration in U-Boot:
* ⇒ setenv autoload no
* ⇒ setenv serverip <serverip> (e.g.: setenv serverip 192.168.100.110)
* ⇒ setenv ipaddr <ipaddr> (e.g.: setenv ipaddr 192.168.100.111)
* ⇒ setenv netmask <netmask> (e.g.: setenv netmask 255.255.255.0)
5. Provide U-Boot the file name of the desired image on the tftp server:
* For U-Boot update: ⇒ setenv uboot <filename>
* For Device Tree update: ⇒ setenv fdt_file <filename>
* For Kernel update: ⇒ setenv zimage <filename>
6. Perform Update:
* U-Boot update: ⇒ run update_uboot
* Device Tree update: ⇒ run update_fdt
* Kernel update: ⇒ run update_kernel
The u-boot update scripts automatically implement the selection of the primary copy to boot.
—-
==== Copy Firmware from SD card to eMMC using U-Boot ====
* Write Image to SD card (use dd command under linux or Win32diskImager under Windows)
* Set Starterkit to boot from SD, please see DIP Switch Settings
* Interrupt the boot process to get to the U-Boot prompt
* Use the following command to copy the SD card to eMMMC
=== Generic command ===
mmc dev 1 && mmc rescan && mmc read ${loadaddr} 0 (number of blocks) && mmc dev 0 && mmc rescan && mmc write ${loadaddr} 0 (number of blocks)
You have to set the number of blocks according to the image size to read entire data that is stored on the SD card and write the same number of blocks to the eMMC.
Formula to calulate the number of blocks
Size of SD card image in bytes / 512. Convert the result to a hex value.
Since the data is stored in the SDRAM on the module the size of the image must not exeed the size of the SDRAM.
=== Example for precompiled SD card image included in BSP Rev.0100 ===
* Size of image-u-boot-fsl-mba6ul-hd.img in byte = 293.601.280
* 293.601.280 / 512 = 573.440
* 540.672 converted to hex value = h8C000
mmc dev 1 && mmc rescan && mmc read ${loadaddr} 0 0x8c000 && mmc dev 0 && mmc rescan && mmc write ${loadaddr} 0 0x8c000
==== Copy rootfs from SD card to eMMC ====
The rootfs is located in the second partition of the SD card/eMMC please see Partition Scheme
example for TQMa6ULx
dd if=/dev/mmcblk0p2 of=/dev/mmcblk1p2 bs=1M
please keep in mind to resize the eMMC rootfs partition,
if the rootfs size was changed in BSP configuration
==== Using NFS boot ====
== Prerequisites ==
* How to setup the NFS Server on your Host Computer
* 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.
* setenv autoload no
* setenv serverip <serverip> (e.g.: setenv serverip 192.168.100.1)
* setenv ipaddr <ipaddr> (e.g.: setenv ipaddr 192.168.0.10)
* setenv netmask <netmask> (e.g.: setenv netmask 255.255.255.0)
* setenv rootpath <rootpath> (NFS share has to set in /etc/exports on the Computer that runs the NFS server first)
* setenv fdt_file <fdt_file> (name of devicetree file to be downloaded from the tftp server)
* setenv zimage <zimage> (name of the Linux kernel image to be downloaded from the tftp server)
==== TQMa6ULx serial downloader ====
Starting with TQMa6ULx-BSP-REV.0104 we deliver a Linux tool to upload U-Boot into the TQMa6ULx RAM from your development host and start it.
After building the BSP the tool is located in:
…/TQMa6ULx.BSP.SW.SRC.0104/platform-MBa6ULx-FSL/packages/host-imx_usb_loader-48a85c0b84611c089cf870638fd1241619324b1d/
You have to apply the following steps before you can start to work with the tool:
* Copy the content of folder …/TQMa6ULx.BSP.SW.SRC.0104/platform-MBa6ULx-FSL/packages/host-imx_usb_loader-48a85c0b84611c089cf870638fd1241619324b1d/usr/etc/ to /usr/etc
* Copy the content of folder …/TQMa6ULx.BSP.SW.SRC.0104/platform-MBa6ULx-FSL/packages/host-imx_usb_loader-48a85c0b84611c089cf870638fd1241619324b1d/usr/bin/ to /bin
==== Usage of serial downloader tool ====
- Set Starterkit to boot-mode “serial downloader”, please see MBa6ULx DIP switch settings
- Connect Starterkit connector X9 (Micro USB cable provided with the Starterkit) to your host
- Connect Starterkit connector X15 (RS232) to your host
- Power up Starterkit
- Please check that Linux recognized a new USB device, see output of command dmesg | grep -i usb. You should see something like the following :
usb 3-2.1: Product: SE Blank 6UL
usb 3-2.1: Manufacturer: Freescale SemiConductor Inc
hid-generic 0003:15A2:007D.0007: hiddev0,hidraw1: USB HID v1.10 Device [Freescale SemiConductor Inc SE Blank 6UL ] on usb-0000:03:00.0-2.1/input0
- Open a serial terminal on your host e.g. TeraTerm
- Open a Linux terminal and naviagate to folder “images” in the BSP dirctory
e.g. /home/embedded/TQMa6ULx.BSP.SW.SRC.0104/platform-MBa6ULx-FSL/images
- Start the serial downloader imx_usb as super user with the desired U-Boot as parameter
Keep in mind to select a U-Boot that is corresponding to your module, please see deployment
e.g.
embedded@ubuntu:~/workspace/TQMa6ULx.BSP.SW.SRC.0104/platform-MBa6ULx-FSL/images$ sudo imx_usb u-boot-fsl-mba6ulx-mmc.imx
Host console output after starting the serial downloader:
config file </etc/imx-loader.d/imx_usb.conf>
vid=0x066f pid=0x3780 file_name=mx23_usb_work.conf
vid=0x15a2 pid=0x004f file_name=mx28_usb_work.conf
vid=0x15a2 pid=0x0052 file_name=mx50_usb_work.conf
vid=0x15a2 pid=0x0054 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0061 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0063 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0071 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x007d file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0076 file_name=mx7_usb_work.conf
vid=0x15a2 pid=0x0041 file_name=mx51_usb_work.conf
vid=0x15a2 pid=0x004e file_name=mx53_usb_work.conf
vid=0x15a2 pid=0x006a file_name=vybrid_usb_work.conf
vid=0x066f pid=0x37ff file_name=linux_gadget.conf
config file </etc/imx-loader.d/mx6_usb_work.conf>
parse /etc/imx-loader.d/mx6_usb_work.conf
15a2:007d(mx6_qsb) bConfigurationValue =1
Interface 0 claimed
HAB security state: development mode (0x56787856)
== work item
filename u-boot-fsl-mba6ulx-mmc.imx
load_size 0 bytes
load_addr 0x00000000
dcd 1
clear_dcd 0
plug 1
jump_mode 2
jump_addr 0x00000000
== end work item
main dcd length 1e0
sub dcd length 1dc
loading binary file(u-boot-fsl-mba6ulx-mmc.imx) to 8fbff400, skip=0, fsize=86c00 type=aa
<<<551936, 551936 bytes>>>
succeeded (status 0x88888888)
jumping to 0x8fbff400
9. Now you can see the U-Boot messages in the serial terminal programm
Next steps are:
* write U-Boot using tftp to eMMC, see Updating existing firmware over ethernet
* write kernel image using tftp to eMMC, see Updating existing firmware over ethernet
===== Images PTXdist =====
Finally, you will find the built images in platform-<platformname>/images.
Complete system image:
* uboot-mba6ulx-hd.img: bootable image for TQMaULx on MBa6ULx (usage on SD Card and eMMC)
* uboot-mba6ulx-lga-hd.img: bootable image for TQMaULxL |(with TQMA6ULXL-MB-ADAP)on MBa6ULx (usage on SD Card and eMMC)
The complete system image is intended for:
* development system initialisation
* deployment
QSPI NOR image without rootfs:
* **uboot-mba6ulx-qspi.img**: bootable image for TQMaULx on MBa6ULx (usage on QSPI NOR, without rootfs)
* **uboot-mba6ulx-lga-qspi.img**: bootable image for ++TQMaULxL (i.e. LGA-Version with adaptor) on MBa6ULx (usage on QSPI NOR, without rootfs)
Bootloader images:
Not to be confused with the u-boot*.bin images, these are just intermediate images and will not be booted by the i.MX6ULx.
Linux images:
firmware partition images:
Rootfs images:
The size of eMMC/SD image exceeds TQMa6ULx RAM size so it is not possible to copy the image into the RAM.
Nevertheless copying is possible by splitting Rootfs into several parts during the process.
setenv install_firmware 'echo MBR... && mmc dev 1 && mmc read $loadaddr 0 1 && mmc dev 0 && mmc write $loadaddr 0 1 && echo U-Boot... && mmc dev 1 && mmc read $loadaddr 2 7fe && mmc dev 0 && mmc write $loadaddr 2 7fe && echo U-Boot environment... && mmc dev 1 && mmc read $loadaddr 800 800 && mmc dev 0 && mmc write $loadaddr 800 800 && echo Firmware Partition... && mmc dev 1 && mmc read $loadaddr 2000 A000 && mmc dev 0 && mmc write $loadaddr 2000 A000 && echo Root FS... && run root_loop'
setenv root_loop 'setenv start 0xC000 && setenv r1 $rootblks16 && while itest $r1 -gt 0; do if itest $r1 -gt 0x2D000; then setenv count 2D000; else setenv count $r1; fi && mmc dev 1 && mmc read $loadaddr $start $count && mmc dev 0 && mmc write $loadaddr $start $count && setexpr start $start + $count && setexpr r1 $r1 - $count; done; setenv r1; setenv start; setenv count'
setenv rootblks16 0x80000
saveenv
run install_firmware
Devicetree can be edit with the fdt commands under U-Boot.
For testing purpose only. For bigger changes, please compile the Devicetree.
Therefore you can have a look at the following
tutorial.
Tested with TQMa6ULx BSP Rev.0100
1) At first the fdt file has to be loaded from the current boot medium (mmc) into RAM.
=> run loadfdt
2) Next step is to set the predefined U-Boot environment variable fdt_addr through the fdt addr command.
=> fdt addr $fdt_addr
3) Afterwards the size of the fdt has to be increased (to the next 4K divider) in order to have some space for modifications. This is simply done by entering:
=> fdt resize
4) List device in the tree you want to change to have a look at the default settings.
Otherwise you can boot your module with the changed Devicetree right after the modification.