~~NOCACHE~~ ===== Build System ===== The BSP is designed to be used with the PTXdist build system. ====== Installation ====== * PTXdist 2012.07.0 (and newer) ===== Preparing the development host ===== Please note:\\ The following was tested on Ubuntu 10.04 / 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 * git 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 is 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:tqma335x: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-cortexa8-linux-gnueabihf_gcc-_glibc-_binutils-_kernel--sanitized.ptxconfig** (for TQMa335) * 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-TQMa335x..tgz to any directory (e.g. ///opt// or ///home//): $ cd /opt/projekte $ tar -xvf OSELAS.BSP-TQ-TQMa335x..tgz $ cd OSELAS.BSP-TQ-TQMa335x. ====== Using the build system ====== ===== Getting help ===== The manual is your friend. See [[en:arm:tqma335x:linux:ptxdist:downloads|Downloads]] where to get it. ===== 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. ===== Compilation ===== Select the platform TQMa335x and start building the images: # select a rootfs-configuration (minimal for example): ptxdist platform configs/platforms/tqma335x/mba335x/platformconfig ptxdist select configs/platforms/tqma335x/mba335x/ptxconfig # we have to use git for the patching because of a binary-patch ptxdist go --git ptxdist images PTXdist downloads some packages. If it reports some errors please * verify your internet connection or proxy settings. * make sure the package source is correct. Some package 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 their hash sums. You have to enter the correct hash in the PTXdist configuration. ===== 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 of the source code. Follow the instructions of the developers section in the PTXdist manual. Changes that are made in the build directories only 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 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-MBa335x/images//. Complete system images: * sd.hdimg is a bootable image primarily for SD Card, but works for eMMC, too. * boot-mlo.vfat fat filesystem with MLO, u-boot and linux-kernel * root.ext2 ext2 rootfs Bootloader images: * u-boot.bin * u-boot.img * MLO (second program loader SPL) Linux images: * linuximage: Kernel (uImage) Rootfs images: * root.ext2 * root.tgz ==== Updating the firmware ==== \\ In this context, firmware refers to a complete system image (see above), including U-Boot, Linux Kernel and Root Filesystem. For convenience, the default U-Boot environment provides several variables, which can be used to transfer (parts of) the firmware between different storage locations (e.g. SD card, eMMC, NFS, ...). The names of these variables adhere to the syntax upd___ with the following options = firmware | uboot | kernel | rootfs = emmc | sd | spi = emmc | sd | net The size of the firmware is stored in ''mmcfirmwareblksize'', please set accordingly if your firmware exceeds the default size of ''0x32000''. For example, to copy the whole firmware from SD card to eMMC execute U-Boot# run upd_firmware_emmc_sd For further details, please have a look at the contents of the respective environment variable, e.g. U-Boot# printenv upd_firmware_emmc_sd upd_firmware_emmc_sd=mmc dev ${sddev} && mmc rescan && mmc read ${loadaddr} 0 ${mmcfirmwareblksize} && mmc dev ${emmcdev} && mmc rescan && mmc write ${loadaddr} 0 ${mmcfirmwareblksize} ===== Adapting BSP for an own product ===== todo 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-mba53 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. ===== Partition scheme ===== todo Changing the partition scheme may affect the boot loader update capability and / or the kernel command line parameters! The following partition scheme is used for SD / eMMC images * sector size 512 Byte The partition scheme is defined using the config files under config/platforms/tqma335x/mba335x/config/images. The creation of the image is controlled using the project local PTXdist package image-sd. 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-MBa335x/build-host/genimage. There is also a README file documenting how to use this tool.