Overview If you just want to build Linux without Yocto.
Instructions Set Up the Environment 1. 2. 3. 4.
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 either powerpc or arm.
Linux can be built with, or without, the Preempt-RT patch. One branch, standard/axxia-dev/base, does not have the Preempt-RT patch, while standard/preempt-rt/axxia-dev/base does. 4. Set BRANCH to either standard/lsi/base or standard/preempt-rt/lsi/base.
Check Out the Branch $ git clone https://github.com/lsigithub/lsi_axxia_yocto_public_3.10.git $ cd lsi_axxia_yocto_public_3.10 $ 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. When on the standard/preempt-rt/axxia-dev/base branch, use tag names that contain “preempt-rt”. Set TAG to the tag name. For example, $ TAG=axxia_linux_preempt-rt_8.8.1.57 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 1
Configure and Build • • • •
For PowerPC targets, use arch/powerpc/configs/axxia_defconfig. For PowerPC targets with Preempt-RT, arch/powerpc/configs/axxia_rt_defconfig. For ARM targets, use arch/arm/configs/axxia_defconfig. For ARM targets with Preempt-RT, use arch/arm/configs/axxia_rt_defconfig.
Note the name of the config file, without the path. For example, axxia_defconfig. $ make $ make -j
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). 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. • Just the device tree. • Linux and the device tree. The simulator only supports using separate images for Linux and the device tree. 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 Create a Flattened Device Tree Once Linux has been built, create the flattened device tree as follows. Note that htis is only necessary if ARCH=powerpc, flattened device trees get built as part of the default target in the ARCH=arm case. 2
make To get a list of available device trees, do the following. ls arch/arm/boot/dts/axm*dts ls arch/powerpc/boot/dts/acp*dts It is only possible to build device trees for the same architecture as the kernel. For ARM, the ‘dtb’ files will be in arch/arm/boot/dts. In the PowerPC case they will be in arch/powerpc/boot. Linux Only • • • •
Copy the following device tree to linux.its. Replace DESCRIPTION with a string, “Axxia Linux” for example. Replace ARCH with either arm or powerpc as appropriate. Replace LOAD and ENTRY with 0x408000 for arm or 0x400000 for powerpc. • 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@1 { description = "Linux Kernel"; data = /incbin/("KERNEL"); type = "kernel"; arch = "ARCH"; os = "linux"; compression = "gzip"; load = ; entry = ; hash@1 { algo = "crc32"; }; hash@2 { algo = "sha1"; 3
}; }; }; configurations { default = "conf@1"; conf@1 { description = DESCRIPTION; kernel = "kernel@1"; }; }; }; Device Tree Only • • • •
Copy the following device tree to fdt.its. Replace DESCRIPTION with a string, “Axxia Linux” for example. Replace ARCH with either arm or powerpc as appropriate. Replace DEVICETREE with the full path to the flattened device tree created above. • mkimage -f fdt.its fdt.fit /dts-v1/; / { description = DESCRIPTION; #address-cells = <1>; images { fdt@1 { description = "Flattened Device Tree blob"; data = /incbin/("DEVICETREE"); type = "flat_dt"; arch = "ARCH"; compression = "none"; hash@1 { algo = "crc32"; }; hash@2 { algo = "sha1"; }; }; }; configurations { 4
default = "conf@1"; conf@1 { description = DESCRIPTION; fdt = "fdt@1"; }; }; }; 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 either arm or powerpc as appropriate. Replace LOAD and ENTRY with 0x408000 for arm or 0x400000 for powerpc. • Replace KERNEL with the full path to the compressed binary Linux kernel created above. • Replace DEVICETREE with the full path to the flattened device tree created above. • mkimage -f multi.its multi.fit /dts-v1/; / { description = DESCRIPTION; #address-cells = <1>; images { kernel@1 { description = "Linux Kernel"; data = /incbin/("KERNEL"); type = "kernel"; arch = "ARCH"; os = "linux"; compression = "gzip"; load = ; entry = ; hash@1 { algo = "crc32"; }; hash@2 { algo = "sha1"; }; };
5
fdt@1 { description = "Flattened Device Tree blob"; data = /incbin/("DEVICETREE"); type = "flat_dt"; arch = "ARCH"; compression = "none"; hash@1 { algo = "crc32"; }; hash@2 { algo = "sha1"; }; }; }; configurations { default = "conf@1"; conf@1 { description = DESCRIPTION; kernel = "kernel@1"; fdt = "fdt@1"; }; }; };
6