Overview If you just want to build Linux without Yocto.
Instructions Set Up the Environment 1. 2. 3. 4. 5.
Add the tool chain to your PATH. Set CROSS_COMPILE to the prefix of the tools added above. Set SYSROOT to the sysroot directory in the tool chain. Set ARCH to arm64 for X9 or XLF or arm for 5500. Set BRANCH to either standard/axxia-dev/base, standard/preemptrt/axxia-dev/base, standard/axxia-dev/base-2.x or standard/preemptrt/axxia-dev/base-2.x.
The *2.x branches implement a temporary work-around for an issue in simulation, this does not affect emulation. The work-around is required when using multiple cores.
Check Out the Branch $ git clone https://github.com/axxia/axxia_yocto_linux_4.1.git $ cd axxia_yocto_linux_4.1 $ git checkout --track -b $BRANCH origin/$BRANCH
Create a Build Branch Based on a Tag To list the available tags, $ git tag | grep axxia Tags are available for both branches described above. To create a build branch based on the tag, do the following. $ git checkout $BRANCH origin/$BRANCH $ git branch build_branch $TAG $ git checkout build_branch
Configure and Build • For 5500, use arch/arm/configs/axxia_5500_defconfig.
1
• For 5600, use arch/arm64/configs/axxia_x9_defconfig. • For Lionfish, use arch/arm64/configs/axxia_xlf_defconfig. For builds on the /preempt-rt/ branches, add rt before defconfig. To configure Linux use just the config name, for example axxia_x9_defconfig, as a make target. Don’t include the path (arch/arm64/configs). $ make $ make -j Note that in some cases, you may have to limit the number of cores used by adding an integre argument to -j, for example, “make -j8”. To add a version string, include LOCALVERSION= when building. Use the output of “git describe --dirty | sed -e 's/axxia_linux_preempt\-rt_//' | sed -e 's/axxia_linux_//'” to match the Intel builds.
Create a Bootable Image Two things are required to boot Linux. • A Linux Kernel • A Device Tree With U-Boot as the boot loader, the above need to be put into a format that U-Boot understands. The following describes using the FIT format (see doc/uImage.FIT/howto.txt in the U-Boot source tree). The device tree compiler (avaiable at https://git.kernel.org/pub/scm/utils/dtc/dtc.git) must be installed; it is called by mkimage. This format allows the image to be verified before it is used. It is possible to put more than one object in a FIT image. The following describes creating three images, • Just the Linux kernel. • Linux and the device tree. • Linux, the device tree, and a root file system. The simulator only supports using separate images for Linux and the device tree. In this case, simply used the device tree binary (.dtb) created during the Linux build process. Create a Compressed Binary Version of Linux from vmlinux $ ${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S vmlinux vmlinux.bin $ gzip -f -9 vmlinux.bin
2
A Flattened Device Tree To get a list of available device trees for X9 or XLF, do the following. ls arch/arm64/boot/dts/intel/ax*dtb For 5500, ls arch/arm/boot/dts/ax*dtb Linux Only • • • •
Copy the following device tree to linux.its. Replace DESCRIPTION with a string, “Axxia Linux” for example. Replace ARCH with arm64 for X9 or XLF or arm for 5500. Replace LOAD and ENTRY with 0x80000 for X9 or XLF or 0x408000 for 5500. • Replace KERNEL with the full path to the compressed binary Linux kernel created above. • mkimage -f linux.its linux.fit /dts-v1/; / {
description = DESCRIPTION; #address-cells = <1>; images { kernel { description = "Linux Kernel"; data = /incbin/("KERNEL"); type = "kernel"; arch = "ARCH"; os = "linux"; compression = "gzip"; load = ; entry = ; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; }; }; }; configurations { 3
};
};
default = "conf"; conf { description = DESCRIPTION; kernel = "kernel"; };
Linux and the Device Tree • • • •
Copy the following device tree to multi.its. Replace DESCRIPTION with a string, “Axxia Linux” for example. Replace ARCH with arm64 for X9 or XLF and arm for 5500. Replace KERNEL with the full path to the compressed binary Linux kernel created above. • Replace DEVICETREE with the full path to the device tree binary from the Linux build. • mkimage -f multi.its multi.fit /dts-v1/; / {
description = DESCRIPTION; #address-cells = <1>; images { kernel { description = "Linux Kernel"; data = /incbin/("KERNEL"); type = "kernel"; arch = "ARCH"; os = "linux"; compression = "gzip"; load = ; entry = ; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; }; }; fdt { description = "Flattened Device Tree blob";
4
};
};
data = /incbin/("DEVICETREE"); type = "flat_dt"; arch = "ARCH"; compression = "none"; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; };
configurations { default = "conf"; conf { description = DESCRIPTION; kernel = "kernel"; fdt = "fdt"; }; };
};
Linux, the Device Tree, and a root file system. As the root file system will reside in memory, it should be small. To create the file system image, start with an ext2 image and compress it gzip -f -9. • • • •
Copy the following device tree to complete.its. Replace DESCRIPTION with a string, “Axxia Linux” for example. Replace ARCH with arm64 for X9 or XLF and arm for 5500. Replace KERNEL with the full path to the compressed binary Linux kernel created above. • Replace DEVICETREE with the full path to the device tree binary from the Linux build. • Replace RAMDISK with the full path to the compressed disk image created above. • mkimage -f multi.its multi.fit /dts-v1/; / {
description = DESCRIPTION; #address-cells = <1>; images { 5
kernel { description = "Linux Kernel"; data = /incbin/("KERNEL"); type = "kernel"; arch = "ARCH"; os = "linux"; compression = "gzip"; load = ; entry = ; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; }; }; fdt { description = "Flattened Device Tree blob"; data = /incbin/("DEVICETREE"); type = "flat_dt"; arch = "ARCH"; compression = "none"; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; }; };
};
ramdisk { description = "Ramdisk Image"; data = /incbin/("RAMDISK"); type = "ramdisk"; arch = "ARCH"; os = "linux"; compression = "gzip"; hash1 { algo = "crc32"; }; hash2 { algo = "sha1"; }; };
6
};
configurations { default = "conf"; conf { description = DESCRIPTION; kernel = "kernel"; fdt = "fdt"; ramdisk = "ramdisk"; }; };
7