~~NOCACHE~~ \\ \\ ====== How-to ====== ===== Bootloader ===== ==== Barebox ==== The barebox bootloader supports update of * bootloader * kernel * devicetree * root FS To update bootloader / kernel / root FS in a running system you have to copy the images in your tftp directory and rename them to the names that the bootloader environment expects. To see the names needed type $ cat /env/config at the bootloader prompt. You can use the update scripts from the barebox environment for update: * update_kernel * update_barebox * update_rootfs To update parts of the barebox environment or the device tree during development you can use also the barebox tftp command. ==== u-boot ==== The u-boot bootloader support update of * bootloader * kernel * devicetree * root FS (only for root FS that fits RAM) You can use the update scripts from the u-boot environment for update: * run update_kernel * run update_uboot * run update_dtb To update parts of the uboot environment or the device tree during development you can use also the uboot tftp command. \\ \\ \\ ===== Using different boot media ===== ==== NFS ==== To boot the MBa53 from network you need a working bootloader in SD-card or eMMC which is able to get the kernel image over tftp and to provide the kernel with commandline settigns for NFS. Depending on the bootloader location the board has to be configured to load the bootloader. See [[.build_system#sd-card|SD-card]] and [[.build_system#emmc|eMMC]]. You have to provide the images via tftp and nfs and to configure the bootloader to work with your tftp-server and your nfs-server The following example is given for the barebox loader used in the BSP: barebox@TQ tqma53: edit /env/config The following settings have to be configured in the script: # or set your networking parameters here eth0.ipaddr= eth0.netmask= eth0.serverip= #eth0.gateway=a.b.c.d #eth0.ethaddr=de:ad:be:ef:00:00 ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask::eth0:off Save environment and reset to make it active: barebox@TQ tqma53: saveenv barebox@TQ tqma53: reset Verify environment settings: barebox@TQ tqma53: printenv Verify eth0 configuration: barebox@TQ tqma53: devinfo eth0 ==== eMMC ==== To initialize the eMMC with an newly created image follow the instructions below: * Use [[.build_system#sd-card|SD-card]] boot * on your development host add an additional ext3 partition to the SD card * copy the uboot_hd.img file to this partition * insert the SD card in MBa53 and boot * copy the image to the eMMC using the following commands: root@tqm:~ mount /dev/mmcblk0p4 /mnt root@tqm:~ cd /mnt root@tqm:/mnt dd if=uboot_hd.img of=/dev/mmcblk1 bs=1M conv=fsync root@tqm:/mnt poweroff * remove SD card * configure for eMMC boot (see table) You can also establish an workflow using the Freescale Manufacturing tool. To boot the MBa53 from an initialized eMMC you have to set the switches S1, S2 and S3. Therfor please have a look at [[en:arm:tqma53:mba53:dip_switches#Boot Device Selection (S2 & S3)|MBa53 DIP switch settings]]. Power up the MBa53. The login is root without any password. If you connect a DVI monitor to X5 you can see the login prompt. ==== SD-Card ==== Copy the hd.img to an SD-card to boot the module via SD-card. $ dd if=platform-MBa53/images/hd.img of=/dev/sd bs=1M conv=fsync You have to use the raw device of the SD card not a partition! To boot the MBa53 from a previously generated SD Card you have to set the switches S1, S2 and S3. Therfor please have a look at [[en:arm:tqma53:mba53:dip_switches#Boot Device Selection (S2 & S3)|MBa53 DIP switch settings]]. Insert the SDcard in X6 and power up the MBa53. The login is root without any password. If you connect a DVI monitor to X5 you can see the login prompt. \\ \\ \\ ===== Use the GPU of i.MX53 ===== GPU support needs additional libraries in userspace. To activate GPU support, you need to select the AMD GPU binary package. **For BSP rev. 0104** Follow the instructions under [[en:arm:tqma53:linux:ptxdist:build_system#configuration| Configuration]] and select "amd gpu binaries" entry. **For BSP rev. 0105** GPU support is preconfigured in the hardware platform and can be found under $ ptxdist menu => select "Configure Hardware Platform" => select "architecture" => i.MX53 OpenGL GPU support fro software development is preconfigured in the software platform and can be found under $ ptxdist menu => select "Graphics and Multimedia" => select "libs" => platform support for OPENGL The package will install following stuff in sysroot-target * shared libraries * includes * static libraries So that development and compilation of OpenVG / EGL based applications is supported. On the target the following will be installed: * sample binaries * shared libraries \\ \\ \\ ===== Adapting barebox environment ===== You can find the barebox documentation at the [[http://wiki.barebox.org/doku.php|barebox homepage]]. Look for the available commands. Barebox uses a config file which is fully documented to store its environment. To make changes on the target system use the barebox edit command: barebox@TQ tqma53: edit /env/config **Attention:** the editor is limited in width and height. Use arrow keys to navigate. Barebox uses shell like script files to automate configurable tasks like boot and update. The scripts can be found under /env/bin and can be edited as well. Extending and / or overwriting the barebox default environment is also possible. Please refer the Barebox and ptxdist documentation. \\ \\ \\ ===== Change device tree ===== The hardware is configured using device tree. The device tree file for TQMa53 / MBa53 is located in //platform-MBa53/build-target/linux-3.5/arch/arm/boot/dts/imx53-a53.dts// after the prepare step of the kernel package. **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-MBa53/images/imx53-a53.dtb And can than be loaded to the device. After saving and resetting the new device tree will be used. **Barebox** barebox@TQ tqma53: tftp imx53-.dtb /env/imx53-a53.dtb barebox@TQ tqma53: saveenv barebox@TQ tqma53: reset **u-boot** TQMa53[MBa53] > setenv dtb imx53-.dtb TQMa53[MBa53] > saveenv TQMa53[MBa53] > run update_dtb \\ \\ \\ ===== Configure USB OTG support ===== Follow the instrunction fro Device tree bindings found under ///Documentation/devicetree/bindings/usb/ci13xxx-imx.txt// \\ \\ \\ ===== Change display type ===== The default configuration of the BSP is to use DVI so that the STKa53 (TQMa53 on MBa53) will work out of the box without needing special display hardware. To change the primary display you have to edit the device tree. ** BSP rev 0105:** Samples for device tree are in the BSP under {BSPROOT}/local_src/dts-tqma53-3.9 see [[en:arm:tqma53:linux:ptxdist:how_to#change_device_tree|here]] how to change device tree. ==== Configure DVI / parallel display ==== To configure have to edit the parallel display node. This is the node with the //compatible = "fsl,imx-parallel-display"// property. * To use DVI * **BSP rev. 0104**: set the edid property * **BSP rev. 0105**: set the ddc property to ddc = <&i2c3>; * To use parallel display add display-timing property and delete edid and ddc property **Hitachi / KAOHSIUNG TX14D11VM1CPD** disp1: display@disp1 { compatible = "fsl,imx-parallel-display"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_disp1_1>; crtcs = <&ipu 1>; interface-pix-fmt = "rgb24"; status = "okay"; display-timings { tx14d11vm1cpd { clock-frequency = <5847953>; hactive = <320>; vactive = <240>; hfront-porch = <30>; hback-porch = <30>; hsync-len = <5>; vback-porch = <5>; vfront-porch = <6>; vsync-len = <2>; pixelclk-active = <1>; hsync-active = <0>; vsync-active = <0>; de-active = <1>; }; }; }; ==== Disable DVI / parallel display ==== To disable the DVI output you have to disable in the parallel display node. This is the node with the //compatible = "fsl,imx-parallel-display"// property Change display@di1 { compatible = "fsl,imx-parallel-display"; status = "ok" crtcs = <&ipu 1>; interface_pix_fmt = "rgb24"; ... }; to display@di1 { compatible = "fsl,imx-parallel-display"; status = "disabled"; crtcs = <&ipu 1>; interface_pix_fmt = "rgb24"; ... }; Also please deselect the "Enable DVI" service in the software configuration. Otherwise the DVI transmitter will be enabled always. ==== Change from DVI to LVDS output ==== * follow instructions [[.:how_to#disable_dvi_parallel_display|to disable DVI / parallel display]] * enable LDB and LVDS channel: ldb@53fa8008 { status = "okay"; lvds-channel@0 { status = "okay"; * configure display timing, resolution and format to the correct values of the display to use. **AUO G156 (1366 x 768)** ldb@53fa8008 { status = "okay"; lvds-channel@0 { status = "okay"; fsl,data-mapping = "spwg"; fsl,data-width = <24>; clock = <76000000>; xres = <1366>; yres = <768>; left-margin = <10>; right-margin = <10>; hsync-len = <200>; lower-margin = <10>; upper-margin = <10>; vsync-len = <38>; }; }; **ChiMei G104X1-L04 (1024 x 768)** ldb@53fa8008 { status = "okay"; lvds-channel@0 { status = "okay"; fsl,data-mapping = "spwg"; fsl,data-width = <24>; /* ChiMei G104X1-L04 */ clock = <65000000>; xres = <1024>; yres = <768>; left-margin = <10>; right-margin = <10>; hsync-len = <200>; lower-margin = <10>; upper-margin = <10>; vsync-len = <38>; }; }; ==== Change from DVI to VGA output ==== * only for Kernel 3.9 * follow instructions [[.:how_to#disable_dvi_parallel_display|to disable DVI / parallel display]] * enable VGA output: @tve { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_vga_sync_1>; ddc = <&i2c3>; fsl,tve-mode = "vga"; fsl,hsync-pin = <4>; fsl,vsync-pin = <6>; status = "okay"; }; \\ \\ \\ ===== Use Audio port ===== **TQMa53 Hardware rev. 0300** Works out of the Box with BSP Revision ≥ 0105. Support for older BSP on Request.\\ Please have a look at our **[[intern:general_information:tutorial:audio|audio tutorial]]**, too. **TQMa53 Hardware rev. 0200** Beginning with hardware revision 0300 the clock source for the audio codec is changed from CKO1 to SSI1_EXT1_CLK. To use older hardware revisions with BSP beginning with rev. 0105 sample device tree files are supplied under //{bsp-root}/local_src/dts-tqma53-3.9/rev.0200// Change device tree following [[.:how_to#change_device_tree | these instructions]] to use audio output. \\ \\ \\ ===== Use the VPU of i.MX53 ===== VPU / CODA driver is implemented as V4L2 device. The device can be used with a gstreamer plugin. Using a media file with H264 content (for instance a matroska container) the VPU can be tested. The following gstreamer pipeline can be used for replay: gst-launch-0.11 \ filesrc location=/root/test.mkv \ ! matroskademux \ ! h264parse \ ! video/x-h264,stream-format=byte-stream,alignment=au \ ! v4l2filter device=/dev/video/by-name/coda \ ! v4l2sink device=/dev/video/by-name/vout **Known limitations:** * The V4L2 vout device is hardwired to the LVDS Display bridge (LDB). * Not all variants the video standards playing smoothly * large displays and large video resolutions can cause bandwidth problems on the system bus \\ \\ \\ ===== Compile kernel / bootloader outside of the BSP ===== * TQ System GmbH development and testing is done under the documented environment. Please consider to use the same environment for testing if you think there are issues. * BSP consists of bootloader, kernel, root FS **and** plumbing for patching, configuration and building images. ==== The big picture ==== Changes to mainline sources of linux kernel and bootloader are provided in the form of patch series. These series are located inside patches directory of the BSP. This directory is either directly under the BSP root or at the same location as the platformconfig file for your hardware platform. The series file describes the order how patches have to be applied. Please note that the patch series are against the documented versions of the bootloader or kernel. If the first patch in the series is a tar.bz2 blob that means this will be a patch that raises the patchlevel from the base version to the bugfix version (for instance from linux 3.2 mainline to linux 3.2.20 stable) ==== Configuration ==== Configuration info is located at the following places: * linux: kernel configuration file is named kernelconfig.x.y and is located at the same location as the platformconfig file for your hardware platform. * barebox: kernel configuration file is named barebox-.config and is located at the same location as the platformconfig file for your hardware platform. The same applies for changes to the barebox default environment. ==== Tools ==== The following list is a selection of tools that are able to work with patch series: * stg (Stacked git) * quilt * git quiltimport (from the git-sh extension) Read manual pages how to use the tools. ==== Steps ==== * Get sources of the versions to build * Apply patches from BSP * Configure packages using the configuration from the BSP * Build ===== u-boot ===== ==== Reset source handling ==== The i.MX53 System Reset Controller provides information about reset sources in the SRSR register. Mainline u-boot as of v2013.01 reads this register and resets information after reading to enable clean info at next boot. Decoding is done for single reset sources only. If your baseboard contains an supervisor which is connected to the reset input of the i.MX53 two reset sources (POR and IPP USER) are detected but not decoded - the reset source is reportes an "unknown".