~~NOCACHE~~ \\ ===== How-to ===== \\ ===== Boot loader ===== ==== Barebox ==== The TQMa6x modules are mainlined in barebox featuring device tree and SPL support. Please note that TQ systems uses U-Boot for testing and verification. In case of differences in pin and clock configuration etc. please contact our technical support. ==== U-Boot ==== For details on using U-Boot see [[http://www.denx.de/wiki/view/DULG/UBootCommandLineInterface | U-Boot Command Line Interface]] === Booting === The default environment is configured to try booting from SD / eMMC card and fall back to booting from net. You can set the environment variable bootcmd, to force either booting from net or from eMMC / SD card: TQMa6Q[MBa6x] U-Boot > setenv bootcmd run netboot TQMa6Q[MBa6x] U-Boot > setenv bootcmd run mmcboot === Updating existing firmware over ethernet === In order to update existing firmware please have a look at our [[en:arm:tqma6x:linux:ptxdist:deployment#Updating existing firmware over ethernet|deployment section]]. === Devicetree fit image BSP Rev.0109 === == Update to fit image == With BSP Rev.0109 fdt fit image was introduced, this image contains all devicetree blob files in one file.To select a specific configuration environment variable **fitfdt_part** By default u-boot is configured for single devicetree. When fdt fit image should be used then u-boot must be configured and updated as follows: - set environment variable **fdt_type** from **single** to **fit**\\ setenv fdt_type fit - set environment variable **fitfdt_file** from **imx6q-mba6x.dtb** to **mba6-image-dtb.itb**\\ setenv fdt_file mba6-image-dtb.itb - save environment settings\\ saveenv - set environment variable **autoload** to **no**\\ setenv autoload no - set ip address manually or get the network configuration via dhcp - set environment variable **serverip** to the ip address where your TFTP server is running\\ setenv serverip xxx.xxx.xxx.xxx - run fdt update run update_fdt == Using fit image == For using the fit image you simply need to modify the u-boot environment variable **fitfdt_part**. \\ ---- ===== Using different boot media ===== \\ **[[en:arm:tqma6x:mba6x:dip_switches#Boot Device Selection (S1, S2, S4 & S5)|Preface]]** * [[en:arm:tqma6x:linux:ptxdist:deployment#Using NFS boot|NFS]] * [[en:arm:tqma6x:mba6x:dip_switches#eMMC|eMMC]] * [[en:arm:tqma6x:mba6x:dip_switches#SD card|SD card]] * [[en:arm:tqma6x:mba6x:dip_switches#SPI-NOR|SPI-NOR]] * ++SATA|\\ \\ under construction\\ ++ \\ ---- ===== Using Starterkit interfaces ===== \\ Please see our [[en:general_information:tutorial|tutorial section]] how to use the interfaces provided on the Starterkit . \\ ---- ===== Change Device Tree ===== The hardware is configured using Device Tree. The Device Tree files for TQMa6x / MBa6x are located in //platform-MBa6x/build-target/linux-/arch/arm/boot/dts/imx6....dts// after the prepare step of the kernel package. Documentation of Device Tree for your kernel version can be found in the kernel tree under Documentation/devicetree **Attention:** Changes in the build directory are not saved. You need to create a patch to make the changes permanent. **Attention:** Changes of the Device Tree must be compiled. To do this enter the following commands: $ ptxdist drop dtc extract $ ptxdist go $ ptxdist images If you only want to update the kernel image you also need to transfer the resulting Device Tree blob to your device. It has to be copied to your tftp directory: $ cp platform-MBa6x/images/imx6-mba6x.dtb And can then be loaded to the device. After saving and resetting the new Device Tree will be used. **U-Boot** TQMa6S[MBa6x] > printenv fdt_file Check name if settings and file name are correct TQMa6S[MBa6x] > run update_fdt \\ ---- ===== Load / Change / Save the Device Tree under U-Boot ===== With "fdt" command under U-Boot we can edit the Devicetree 1) Load the fdt from mmc in to RAM mmc dev ${mmcdev}; mmc read ${fdt_addr} ${fdt_start} ${fdt_size}; 2) Set your $fdt_addr as fdt address for the fdt command fdt addr ${fdt_addr} 3) Resize the fdt to "+4k" fdt resize 4) Identify your tree in the Device Tree fdt print - recursive print of your path (e.g / -> Prints the whole Devicetree. /soc -> everything under "/soc") fdt list - Prints only the Top level of path (e.g / -> Lists only the "First" Level. /soc -> Prints the First level of all devices under "/soc" 5) Change values of properties fdt set "your path" "your property" "your value" e.g: fdt set /display@0 status okay 6) Write the changed Device Tree from RAM to mmc 'mmc dev ${mmcdev}; mmc write ${fdt_addr} ${fdt_start} ${fdt_size};' For testing purpose only. For bigger changes, please compile the Devicetree \\ ---- ===== Using GPU ===== The following applies to BSP Rev. ≥ 0105 During kernel boot the GPU requests 128 MiB of linear address space, which is why the CMA pool has to be increased for proper GPU support. Simply set the ''cma_size'' U-Boot variable as follows: setenv cma_size 160M saveenv ==== Install Vivante GPU examples ==== root@MBa6x:cd /path/to /your/bsproot/\\ root@MBa6x:/path/to/your/bsproot ptxdist platformconfig\\ Enter **architecture** and select **install gpu examples and demos**. The demos will be installed under **/opt/viv_samples** === Running Vivante GPU examples === root@MBa6x:cd opt/viv_samples root@MBa6x:/opt/viv_samples ./es20/vv_launcher/vv_launcher ==== Install Vivante GPU SDK examples ==== root@MBa6x:cd /path/to /your/bsproot/ root@MBa6x:/path/to/your/bsproot ptxdist platformconfig Enter **architecture** and select **install gpu SDK examples**. The examples will be installed under **/opt/gpu_sdk_v1.00** ==== Install Qt5 examples ==== please keep in mind to increase the cma_size to use the Qt demos root@MBa6x:cd /path/to /your/bsproot/ root@MBa6x:/path/to/your/bsproot ptxdist menuconfig Enter **Graphics and Multimedia** in the following menu enter **qt**, select **install Qt5 examples**. The examples will be installed under **/usr/bin/qt5-examples** === Running Qt5 examples === root@Mba6x:mount -o remount,rw / root@MBa6x:cd /usr/bin/qt5-examples/quick/demos/clocks root@MBa6x:/usr/bin/qt5-examples/quick/demos/clocks/chmod a+x clocks root@MBa6x:/usr/bin/qt5-examples/quick/demos/clocks/./clocks Please note that depending on configuration installing all options can exceed the configured size of the root file system.\\ Some GPU demos are not working with HDMI and FullHD To do basic tests for Multitouch functionality please use commandline applications **evtest** or **mtdev-test** \\ ---- ===== Using VPU ===== Since BSP Revision 0109 the VPU of i.MX6 is supported.\\ For testing the VPU we have included a small sample video file in the BSP rootfilesystem:\\ ''/usr/share/media/video/TQ-in-20-Sekunden-720P_Rev002.mp4'' To avoid allocation errors please increase the value of the variable ''cma_size'' in u-boot to //256M//. To play the videofile on the starterkit with //gstreamer// you need to set up a gstreamer pipeline. For example: root@MBa6x:~ gst-launch-1.0 filesrc location=/usr/share/media/video/TQ-in-20-Sekunden-720P_Rev002.mp4 ! qtdemux ! h264parse ! v4l2video1dec ! v4l2video2convert ! fbdevsink The //gstreamer// components may differ from those shown in this example, to get a list of the available //gstreamer// components please run ''gst-inspect-1.0''. \\ ---- ===== Change / adapt display type ===== Configuration of display type and display support depends on the kernel version used since the drivers are at least partly in staging. When displays or display settings are altered the device tree has to be modified. See [[en:arm:tqma6x:linux:ptxdist:how_to#change_device_tree|here]] how to change device tree. ==== Configure HDMI ==== Beginning with **linux 3.16-rc5** (BSP REV.0104) a devicetree with special settings for HDMI is compiled. * imx6dl-mba6x-hdmi.dtb : devicetree with HDMI settings for TQMa6S and TQMa6L * imx6q-mba6x-hdmi.dtb : devicetree with HDMI settings for TQMa6D and TQMa6Q Correct working of the HDMI driver depends on the function of the HPD signal of the Monitor. ==== Configure HDMI Freescale kernel ==== U-Boot envenvironment must be reconfigured to enable HDMI on Freescale kernel setenv addfb 'setenv bootargs ${bootargs} consoleblank=0 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 fbmem=32M' ==== Configure parallel display ==== under construction Beginning with **linux 3.16-rc5** (BSP REV.0104) a devicetree with special settings for parallel display is compiled. To change the display type, you need to change the default timing and - in case timing is not supplied yet - the correct display timing has to be entered in device tree. ==== Configure LVDS ==== To use LVDS display with frame buffer support, make sure to disable other displays in the device tree (set the status property of the node to "disabled"). To enable the LVDS output you have to * enable the LDB and the LBD port(s) in arch/arm/boot/dts/imx6qdl-mba6x.dtsi * configure video timing for your display Timing examples: ++++Sharp lq085y3lg13| lq085y3lg13 { /* needs fsl,data-width = <18> */ clock-frequency = <26200000 26600000 27000000>; hactive = <800>; vactive = <480>; hfront-porch = <10>; hback-porch = <0>; hsync-len = <255>; /* FIXME: typ < 256!!*/ vback-porch = <0>; vfront-porch = <2>; /* move 2 lines up */ vsync-len = <40 45 50>; de-active = <1>; hsync-active = <0>; vsync-active = <0>; }; ++++ ++++AUO auo-g156-xw01| auo-g156-xw01 { clock-frequency = <60000000 76000000 90000000>; hactive = <1366>; vactive = <768>; hfront-porch = <10>; hback-porch = <10>; hsync-len = <80 200 570>; vback-porch = <100>; vfront-porch = <10>; vsync-len = <10 38 120>; de-active = <1>; hsync-active = <0>; vsync-active = <0>; }; ++++ ++++CHIMEI g104-x1| chimei-g104-x1 { clock-frequency = <55000000 65000000 75000000>; hactive = <1024>; vactive = <768>; hfront-porch = <75>; hback-porch = <10>; hsync-len = <76 255 776>; /* FIXME: typ < 256!*/ vback-porch = <100>; vfront-porch = <10>; vsync-len = <2 38 182>; de-active = <1>; hsync-active = <0>; vsync-active = <0>; }; ++++ ++++CHIMEI g070y2-l01| chimei-g070y2-l01 { clock-frequency = <27000000 29500000 33000000>; hactive = <800>; vactive = <480>; hfront-porch = <0>; hback-porch = <0>; hsync-len = <130 192 290>; vback-porch = <0>; vfront-porch = <2>; vsync-len = <10 20 70>; de-active = <1>; hsync-active = <0>; vsync-active = <0>; }; ++++ ===== TQMa6x BSP REV.0110 Display ===== With BSP REV.0110 the kmsfb wrapper was introduced for the compability between linux mainline kernel and the Vivante GPU driver. The kmsfb wrapper emulates a framebuffer device from the kernel mode settings and requires a proper configuration file **/etc/kmsfb-manage.conf**. To show the current drm information please execute **''[color=black]kmsfb-manage -s[/color]''** in the linux shell. Please see the example output below after executing **''[color=black]kmsfb-manage -s[/color]''** on a Starterkit with HDMI display connected: root@MBa6x:/usr/lib/qt5/examples/webview/minibrowser kmsfb-manage -s ------------------------ Current Layout ------------------------ CRTCs: id: 18 fb id: 0 x: 0 y: 0 id: 22 fb id: 0 x: 0 y: 0 Connectors: id 25 current encoder: 24 type: HDMI-A mode0: 1680x1050@60 mode1: 1280x1024@75 mode2: 1280x1024@60 mode3: 1152x864@75 mode4: 1024x768@75 mode5: 1024x768@60 mode6: 800x600@75 mode7: 800x600@60 mode8: 800x600@56 mode9: 848x480@60 mode10: 640x480@75 mode11: 640x480@60 mode12: 640x480@60 mode13: 720x400@70 Property: EDID id : 1 flags : 20 count_values : 0 count_enums : 0 blob is 128 length, FFFFFF00 Property: DPMS id : 2 flags : 8 count_values : 4 values : 0 1 2 3 count_enums : 4 0 = On 1 = Standby 2 = Suspend 3 = Off con_value : On Encoders: 1 id: 24 crtc id: 0 possible crtcs: 0x00000003 possible clones: 0x00000000 Framebuffers: 0 Planes: 1 id: 20 The following values are required to create the kmsfb configuration file: * mode0: [color=red]1680[/color]x[color=blue]1050[/color]@60 * Connectors: id [color=green]25[/color] * current encoder: [color=orange]24[/color] * crtc id: [color=purple]0[/color] After determining the appropriate values the file **/etc/kmsfb-manage.conf** can be edited. Please see the example configuration for a HDMI display below: ''[color=black]-f bpp=32,xres=[/color][color=red]1680[/color],[color=black]yres=[/color][color=blue]1050[/color][color=black],fill=1,3d=1,vsync=0 -w fbid=0,connector=[/color][color=green]25[/color][color=black],encoder=[/color][color=orange]24[/color][color=black],crtc=[/color][color=purple]0[/color]'' After editing the **kmsfb-manage.conf** file please reboot the Starterkit to activate the display configuration. \\ ---- ===== Compile kernel/bootloader outside of the BSP ===== To compile the kernel/bootloader outside of the BSP, please have a look at the corresponding **[[en:general_information:tutorial:comp_kernel_bootloader| tutorial]]**. \\ ---- ===== Setup the Ethernet devices under U-Boot ===== ==== USB-ETH ==== 1) Set environment variable //usbethaddr// No longer necessary for BSP Rev. ≥0109 setenv usbethaddr 2) Start to detect USB device usb start 3) To use Ethernet device "sms0" under U-Boot you have to change the active Ethernet device setenv ethact sms0 Available Ethernet devices are "sms0"(X12) and "FEC"(X11) If no link activity shown in U-Boot see [[en:arm:tqma6x:linux:ptxdist:known_issues#u-boot|Known Issues]] \\ ---- ===== WEIM bus ===== The following documents are required to fully comprehend the following contents: * [[http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6SDLRM.pdf?fasp=1&WT_TYPE=Reference%20Manuals&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation&fileExt=.pdfCPU|Reference Manual IMX6 S/DL]] * [[http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/bus/imx-weim.txt|Documentation device tree bindings]] The term "wireless" does not imply that the WEIM is literally an interface without wires. It simply means that this module was originally designed for wireless and mobile applications that use low-power technology. The actual devices are instantiated from the child nodes of a WEIM node. ==== Device tree documentation ==== ++++Required properties| **- compatible:**\\ Should contain one of the following:\\ "fsl,imx1-weim"\\ "fsl,imx27-weim"\\ "fsl,imx51-weim"\\ "fsl,imx50-weim"\\ "fsl,imx6q-weim"\\ **- reg:**\\ A resource specifier for the register space\\ (see the example below)\\ **- clocks: **\\ the clock, see the example below.\\ **- #address-cells:**\\ Must be set to 2 to allow memory address translation\\ **- #size-cells:**\\ Must be set to 1 to allow CS address passing\\ **- ranges:**\\ Must be set up to reflect the memory layout with fourinteger values for each chip-select line in use:\\ 0 ++++ ++++Optional properties| **- fsl,weim-cs-gpr:**\\ For "fsl,imx50-weim" and "fsl,imx6q-weim" type of devices, it should be the phandle to the system General Purpose Register controller that contains WEIM CS GPR register, e.g. IOMUXC_GPR1 on i.MX6Q. IOMUXC_GPR1[11:0] should be set up as one of the following 4 possible values depending on the CS space configuration. ^ IOMUXC_GPR1 [11:0]] ^ CS0 ^ CS1 ^ CS2 ^ CS3 ^ ^ 05 | 128M | 0M | 0M | 0M | ^ 033 | 64M | 64M | 0M | 0M | ^ 0113 | 64M | 32M | 32M | 0M | ^ 01111 | 32M | 32M | 32M | 32M | In case that the property is absent, the reset value or what bootloader sets up in IOMUXC_GPR1[11:0] will be used. Timing property for child nodes. It is mandatory, not optional. **- fsl,weim-cs-timing:**\\ The timing array, contains timing values for the child node. We can get the CS index from the child node's "reg" property. The number of registers depends on the selected chip.\\ For i.MX35 ("fsl,imx27-weim") there are three registers: CSCRxU, CSCRxL, CSCRxA.\\ For i.MX53 ("fsl,imx50-weim") and i.MX6Q("fsl,imx6q-weim")and i.MX6DL("fsl,imx6q-weim") and there are six registers: CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2.\\ ++++ ==== Example for WEIM Bus ==== * Example code for Linux 3.14 * Customized pinmuxing * Customized timing * For Linux 3.16 fsl,weim-cs-gpr = <&gpr>; must be added * Line 15 must be customized * Line 18 Mainboard xyz must be customized * Line 19 mainboard must be costumized ++++Device tree example| 12 /dts-v1/; 13 14 #include "imx6dl-tqma6s.dtsi" 15 #include "imx6qdl-.dtsi" 16 17 / { 18 model = "TQ TQMa6S on Mainnboard xyz"; 19 compatible = "tq,mainboard", "tq,tqma6s", "fsl,imx6dl"; 20 … 215 &iomuxc { … 454 weim { 455 pinctrl_weim_1: weim-grp1 { 456 fsl,pins = < 457 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED) */ 458 #define PAD_CTL_EIM_ADDR 0x00010098 459 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED | PAD_CTL_PKE) */ 460 #define PAD_CTL_EIM_DATA 0x00011098 461 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED | PAD_CTL_PUS_100K_UP) */ 462 #define PAD_CTL_EIM_CTRL 0x0001b098 463 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED) */ 464 #define PAD_CTL_EIM_RW 0x00010098 465 MX6QDL_PAD_EIM_DA0__EIM_AD00 PAD_CTL_EIM_ADDR 466 MX6QDL_PAD_EIM_DA1__EIM_AD01 PAD_CTL_EIM_ADDR 467 MX6QDL_PAD_EIM_DA2__EIM_AD02 PAD_CTL_EIM_ADDR 468 MX6QDL_PAD_EIM_DA3__EIM_AD03 PAD_CTL_EIM_ADDR 469 MX6QDL_PAD_EIM_DA4__EIM_AD04 PAD_CTL_EIM_ADDR 470 MX6QDL_PAD_EIM_DA5__EIM_AD05 PAD_CTL_EIM_ADDR 471 MX6QDL_PAD_EIM_DA6__EIM_AD06 PAD_CTL_EIM_ADDR 472 MX6QDL_PAD_EIM_DA7__EIM_AD07 PAD_CTL_EIM_ADDR 473 MX6QDL_PAD_EIM_DA8__EIM_AD08 PAD_CTL_EIM_ADDR 474 MX6QDL_PAD_EIM_DA9__EIM_AD09 PAD_CTL_EIM_ADDR 475 MX6QDL_PAD_EIM_DA10__EIM_AD10 PAD_CTL_EIM_ADDR 476 MX6QDL_PAD_EIM_DA11__EIM_AD11 PAD_CTL_EIM_ADDR 477 MX6QDL_PAD_EIM_DA12__EIM_AD12 PAD_CTL_EIM_ADDR 478 MX6QDL_PAD_EIM_DA13__EIM_AD13 PAD_CTL_EIM_ADDR 479 MX6QDL_PAD_EIM_DA14__EIM_AD14 PAD_CTL_EIM_ADDR 480 MX6QDL_PAD_EIM_DA15__EIM_AD15 PAD_CTL_EIM_ADDR 481 MX6QDL_PAD_EIM_A16__EIM_ADDR16 PAD_CTL_EIM_ADDR 482 MX6QDL_PAD_EIM_A17__EIM_ADDR17 PAD_CTL_EIM_ADDR 483 MX6QDL_PAD_EIM_A18__EIM_ADDR18 PAD_CTL_EIM_ADDR 484 MX6QDL_PAD_EIM_CS0__EIM_CS0_B PAD_CTL_EIM_CTRL 485 MX6QDL_PAD_EIM_OE__EIM_OE_B PAD_CTL_EIM_CTRL 486 MX6QDL_PAD_EIM_RW__EIM_RW PAD_CTL_EIM_RW 487 MX6QDL_PAD_CSI0_DATA_EN__EIM_DATA00 PAD_CTL_EIM_DATA 488 MX6QDL_PAD_CSI0_VSYNC__EIM_DATA01 PAD_CTL_EIM_DATA 489 MX6QDL_PAD_CSI0_DAT4__EIM_DATA02 PAD_CTL_EIM_DATA 490 MX6QDL_PAD_CSI0_DAT5__EIM_DATA03 PAD_CTL_EIM_DATA 491 MX6QDL_PAD_CSI0_DAT6__EIM_DATA04 PAD_CTL_EIM_DATA 492 MX6QDL_PAD_CSI0_DAT7__EIM_DATA05 PAD_CTL_EIM_DATA 493 MX6QDL_PAD_CSI0_DAT8__EIM_DATA06 PAD_CTL_EIM_DATA 494 MX6QDL_PAD_CSI0_DAT9__EIM_DATA07 PAD_CTL_EIM_DATA 495 >; 496 }; 497 }; 498 }; … ++++ ++++Example Code for TQMa6S| 596 &weim { 597 pinctrl-names = "default"; 598 pinctrl-0 = <&pinctrl_weim_1>; 599 /* 0 */ 600 ranges = <0 0 0x08000000 0x08000000>; 601 #address-cells = <2>; 602 #size-cells = <1>; 603 status = "okay"; 604 605 sram@0,0 { 606 compatible = "tq,sram"; 607 #address-cells = <1>; 608 #size-cells = <1>; 609 reg = <0 0 0x0080000>; 610 bank-width = <1>; 611 /* optimized settings for device at CS0 */ 612 /* CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2 */ 613 /* 614 * timing for SRAM: we have 8 Bit data and 19 Bit 615 * address 616 */ 617 fsl,weim-cs-timing = < 618 0x60240001 0x00001000 0x07f11101 619 0x00000000 0x0f249241 0x00000000 620 >; 621 }; 622 }; ++++ ==== Supply TQMa6x RTC on MBa6x ==== To supply the TQMa6x RTC from CR2032 on MBa6x, please set a jumper bridge between X31_3 and X31_2. \\ ---- ===== TQMa6x serial downloader ===== In order to use serial downloader please have a look at our [[en:arm:tqma6x:linux:ptxdist:deployment#TQMa6x serial downloader|deployment section]]. * Currently (Oct. 2015) the latest i.MX6 silicon revision is 1.3. Why do both U-Boot and Linux kernel report silicon revision 1.5?|\\ \\ The value reported by U-Boot and the Linux kernel is actually the ROM revision. According to the Freescale document [[http://cache.freescale.com/files/microcontrollers/doc/eng_bulletin/EB803.pdf|EB803 (table 1)]] the ROM revision may not match the silicon revision. \\ ---- \\ * ts_calibrate shows the following error **"tslib: Selected device is not a touchscreen (must support ABS and KEY event types)"** with parallel Display ETM0700G0DH6.\\ \\ To fix this yo have to export the TSLIB_TSDEVICE:\\ export TSLIB_TSDEVICE=/dev/input/event2