~~NOCACHE~~ ===== Build System ===== ===== PTXdist ===== * 2013.03.0 (prerelease BSP 20130704 / 20130719) * 2013.12.0 (BSP Rev.0101 - BSP Rev.0104) * 2014.11.0 (BSP Rev.0105) ===== Toolchain ===== ==== BSP Rev. 0101 and newer ==== * OSELAS.Toolchain-2013.12.2 / gcc 4.8.3 / linaro-4.8-2013.11 (arm-v7a-linux-gnueabihf) ==== BSP Rev. 0100 and older ==== * OSELAS.Toolchain-2012.12.1 / gcc 4.7.3 / linaro-4.7-2012.11 (arm-cortexa9-linuxgnueabi) * OSELAS.Toolchain-2012.12.0 / gcc 4.7.3 / linaro-4.7-2012.11 (arm-cortexa9-linuxgnueabi) ==== Preparing the development host ==== Please note:\\ The following was tested on Ubuntu 12.04. All newer distributions should work. To install PTXdist you need Linux on your development workstation (or a virtual machine running Linux). The build system needs some additional packages which may be normally not installed by default. These packages are (names should match for Debian based systems): * gawk * dialog * ncurses-dev * bison * flex * quilt * texinfo * gettext * g++ * libxml-parser-perl For development it is recommended to have an [[en:tftp|tftp server]] for image download and update and an [[en:nfs|nfs server]] for network mounted rootfs configured and running. ==== Build system installation ==== After installing all packages download PTXdist source, configure, compile and install. See [[.:downloads| download page]] for links. Extract the package ptxdist-.tar.bz2 to a temporary directory and call: $ ./configure $ make $ sudo make install This will install PTXdist to /usr/local. Afterwards please configure PTXdist with: $ ptxdist setup You have to setup the following things: * ftp / http proxies * username and mail address * path for archive of downloaded source packages (aka local package pool) * for further setup details see PTXdist manual ... Note: you can install more than one PTXdist version in parallel. Then the best way ist to setup an symbolic link to the version needed in your BSP. ==== Toolchain installation ==== See [[.:downloads| download page]] for links to toolchain download. If using precompiled toolchain install to ///opt//. Otherwise carefully follow the documentation for building toolchains found [[http://www.pengutronix.de/software/ptxdist/appnotes/AppNote_BuildingToolchain.pdf|here]] or in the [[en:arm:tqma53:linux:ptxdist:downloads|download section]].\\ By default the toolchain will get installed to ///opt/OSELAS.Toolchain-//. Follow chapter "Building a toolchain" in the PTXdist manual and keep in mind: * When you are asked to run the command $ ptxdist select ptxconfigs/...select this ptxconfig: **ptxconfigs/arm-cortexa9-linux-gnueabi_gcc-_glibc-_binutils-_kernel--sanitized.ptxconfig** (for TQMa6x) * To build the toolchain project you should install the corresponding PTXdist version for the Toolchain (as told in the documentation). The Toolchain normally is already setup in the BSP project. So you can move on to the next step. ==== BSP installation ==== Extract the package OSELAS.BSP-TQ-TQMA6x..tgz to any directory (e.g. ///opt// or ///home//): $ cd /opt/projekte $ tar -xvf OSELAS.BSP-TQ-TQMA6x..tgz $ cd OSELAS.BSP-TQ-TQMA6x ===== Using the build system ===== ==== Getting help ==== The manual is your friend. See [[en:arm:tqma6x:linux:ptxdist:downloads|Downloads]] where to get it. ==== Compilation ==== To start compilation you have to select * Hardware configuration (architecture, toolchain kernel, bootloader, image generation) * Software configuration The BSP contains reasonable configurations to enable quick start. Enter the following commands to select the configuration: $ ptxdist platform configs/platform-tq-mba6x/platformconfig $ ptxdist select configs/ptxconfig Start building the images: $ ptxdist go $ ptxdist images PTXdist downloads package source to your configured loacal source pool if needed. This pool can be shared by several workstations to minimize download times. If it reports some errors, please * verify your internet connection and proxy settings. * make sure the package source is correct. Some packege source pages will change from time to time. (You can always try to download the source package manually and copy it to your package pool) * some packages like bootloaders and kernels where you can select versions need to know about there md5 hash sums. You have to enter the correct hash in the PTXdist configuration. ==== Configuration ==== To configure the system (e.g. add additional packages) you can start the PTXdist menu: $ ptxdist menu To add additional packages to your root filesystem simply use the ptxdist tool. The ncurses based UI is the same that is used by the linux kernel with "make menuconfig". It can be used the following way: * use the up / down arrow keys to navigate in the menu * use the left / right arrow keys to navigate between buttons * select / deselect packages and options using the SPACE key * enter submenus or press buttons using the ENTER key Dependencies between packages should be “automagically” resolved. Software is organized in sections. ==== Changing packages ==== PTXdist uses release tar balls for software it loads from the net. You have to work with patches, if you need to make changes to the source code. Follow the instructions of the developers section in the PTXdist manual. Changes that are made in the build directories will be deleted, when PTXdist needs to redo a buildstep. ==== Adding own packages ==== PTXdist needs a package for every bit you need in your root FS to guarantee reproducible builds. To add your software, files etc. you have to provide local packages. Follow the instructions of the developers section in the PTXdist manual. PTXdist provides templates as starting point for own packages. Type $ ptxdist newpackage to see what package templates exist. ==== Deployment ==== Finally, you will find the built images in //platform-MBa6x/images//. Complete system images: * uboot_tqma6s_hd.img : bootable image for TQMa6S on MBa6x (usage on SD Card and eMMC) * uboot_tqma6dl_hd.img: bootable image for TQMa6L on MBa6x (usage on SD Card and eMMC) * uboot_tqma6q_hd.img : bootable image for TQMa6Q on MBa6x (usage on SD Card and eMMC) The complete system images are intended for * development system initialisation * deployment 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.MX6. * u-boot-TQMa6S_MBa6x.imx: U-Boot bootloader for TQMa6S on MBa6x (usage on SD Card and eMMC) * u-boot-TQMa6S_MBa6x_SPI.imx U-Boot bootloader for TQMa6S on MBa6x (usage on SPI-NOR) * u-boot-TQMa6DL_MBa6x.imx: U-Boot bootloader for TQMa6L on MBa6x (usage on SD Card and eMMC) * u-boot-TQMa6DL_MBa6x_SPI.imx U-Boot bootloader for TQMa6L on MBa6x (usage on SPI-NOR) * u-boot-TQMa6Q_MBa6x.imx: U-Boot bootloader for TQMa6Q/TQMa6D on MBa6x (usage on SD Card and eMMC) * u-boot-TQMa6Q_MBa6x_SPI.imx U-Boot bootloader for TQMa6Q/TQMa6D on MBa6x (usage on SPI-NOR) Linux images: * linuximage: Kernel (zImage) * imx6dl-mba6x.dtb: device tree blob for TQMa6S and TQMa6L on MBa6x * imx6q-mba6x.dtb: device tree blob for TQMa6Q on MBa6x Rootfs images: * root.tgz: Root file system archive (for NFS etc.) * root.ext2: Root file system partition image (for system update) ==== Partition scheme ==== Changing the partition scheme may affect the boot loader update capability and / or the kernel command line parameters! === SD / eMMC images === * sector size 512 Byte * unpartitioned area: 4MiB (0x2000 sectors) ^ Sector ^ Size ^ Usage ^ |0x0000 ... 0x0000 | 0x0001 sector / 512 Byte| MBR / Partition Table | |0x0001 ... 0x0001 | 0x0001 sector / 512 Byte| reserved for ROM loader *) | |0x0002 ... 0x07ff | 0x07fe sectors | u-boot | |0x0800 ... 0x0fff | 0x0800 sectors / 1MiB | environment | |0x1000 ... 0x17ff | 0x0800 sectors / 1MiB | device tree blob | *) See CPU reference Manual. This sector can be used for Redundant Boot Support * partitioned area: ^ Partition ^ Size ^ Usage ^ | 1 | 4 MiB | Kernel image | | 2 | 256 MiB | root FS | | 3 | 256 MiB | Spare, not formatted | | 4 | ---- | ---- | The partition scheme is defined using the config file config/platform-tq-mba6x/config/uboot-hd.config. The creation of the image is controlled using the PTXdist packages image-uboot-tqma6-hd. To create the image the genimage host tool is used. This tool is automatically selected and built. You can find the build directory under /platform-MBa6x/build-host/genimage. There is also a README file documenting how to use this tool. === SPI NOR === * sector size 64 KiB ^ Sector ^ Size ^ Usage ^ |0x0000 ... 0x0007 | 0x0008 sectors / 512 KiB | U-Boot *) | |0x0008 ... 0x0008 | 0x0001 sector / 64 KiB | environment0 | |0x0009 ... 0x0009 | 0x0001 sector / 64 KiB | environment1 | |0x000a ... 0x000a | 0x0001 sectors / 64 KiB | devicetree | |0x000b ... 0x000f | 0x0005 sectors / 320 KiB | devicetree | |0x0010 ... 0x0070 | 0x0060 sectors / 6 MiB | Kernel | *) See CPU reference Manual. The U-Boot image must be placed at offset 0x400 ==== Adapting BSP for an own product ==== The BSP was developed for the starterkit. To use it in a product with special needs or a different basebord we suggest to define an own platform. To start with it make a copy of the platform definition and select the new platform definition $ cd $ cp -r /configs/platform-tq-mba6x to /configs/ $ ptxdist platform /configs//platformconfig To start configuring your new platform type $ ptxdist platformconfig The first thing to change should be the platform name. Adapt things like kernel configuration, image creation etc. to your needs. The new system will be built under /platform- Please read the build system documentation howto go further. Keep in mind that custom mainboards may need changes in bootloader and device tree. Give the new bootloader config and device tree a new name to cleanly distinguish them from the starterkit mainboard configuration. If creating BSP for a new motherboard, make sure to create new configurations for bootloaders and device tree.