... | ... | @@ -5,19 +5,21 @@ |
|
|
1) First we need to get the Linux kernel source
|
|
|
`git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git`
|
|
|
|
|
|
2) Next we'll have to get [some patches](https://github.com/ppisa/zynq-rt-utils-and-builds/tree/master/projects/linux/patches) that will generate a Device Tree Blob that we'll need to make the kernel boot. The first one is the most important. Apply it with `git apply`.
|
|
|
2) Optionally we can apply the [realtime patchset](https://cdn.kernel.org/pub/linux/kernel/projects/rt/) for the current kernel version
|
|
|
|
|
|
2) Next we'll have to get [some more patches](https://github.com/ppisa/zynq-rt-utils-and-builds/tree/master/projects/linux/patches) that will generate a Device Tree Blob that we'll need to make the kernel boot. The first one is the most important. Apply it with `git apply`.
|
|
|
|
|
|
2) The latency tester also needs the CTU CAN FD driver to be patched to support hardware timestamps. These patches will be part of the mainline kernel in the future and will no longer be neccessary. For now they are available [here](https://gitlab.fel.cvut.cz/vasilmat/linux-can-test/) on the `ctucanfd-timestamps` branch.
|
|
|
|
|
|
3) When compiling on a CPU with architecture different than armhf, we need to install the toolchain needed for cross-compilation. On Debian the package is called `gcc-arm-linux-gnueabihf`. Apart from that, every time `make` is called we must provide `ARCH` and `CROSS_COMIPLE` variables. To make this easy we can use this [Makefile](https://github.com/ppisa/zynq-rt-utils-and-builds/blob/master/projects/linux/build/arm/zynq/GNUmakefile) which also simplifies placing build files outside the source directory. Simply create a directory for the build files, place the Makefile there and modify it so that the path on line 19 points to your kernel source.
|
|
|
|
|
|
4) Next the kernel needs to be configured. Make the default configuration by running `make defconfig` in the build directory, open the generated `.config` file in the source directory and replace everything from General Setup forward with content from the following file: (.....)
|
|
|
4) Next the kernel needs to be configured. Make the default configuration by running `make defconfig` in the build directory, open the generated `.config` file and replace everything from General Setup forward with content from the following file: [.config](uploads/6c2fb69aebbbe8e99e7dd20c2fdc0697/.config)
|
|
|
Most notably, these options need to be enabled (.....)
|
|
|
You can also run `make menuconfig` afterwards and in the System Type section remove support for some unneeded SoCs to reduce the amount of things that need to be compiled.
|
|
|
|
|
|
5) Compile the kernel by running `make -j4` (-j4 will run compilation on 4 cores in parallel)
|
|
|
|
|
|
6) Next we can take the resulting zImage along with dts/zynq-microzed-uart0.dtb from arch/arm/boot in the build directory and place it on the boot partition of the SD card into zynq/mzapo/images/linux. The image will then need to be packed into another image that can be booted by UBoot. This image is described in the file `uboot-image.its` under `mzapo` directory. Open this file and make sure the `data` fields point to correct files. `system.bit.gz` is in the root of the partition and intramfs is the following: (.....)
|
|
|
6) Next we can take the resulting zImage from arch/arm/boot in the build directory and place it on the boot partition of the SD card into zynq/mzapo/images/linux. Another file we'll need is `zynq-microzed-uart0.dtb`. The one that was generated with the kernel does not support overlays, so it has to be built manually by running `dtc -O dtb -b 0 -@ -o arch/arm/boot/dts/zynq-microzed-uart0.dt{b,s}` in the directory with linux source. The image and dtb will then need to be packed into another image that can be booted by U-Boot. This image is described in the file `uboot-image.its` under `mzapo` directory. Open this file and make sure the `data` fields point to correct files. `system.bit.gz` is in the root of the partition and ramdisk is the following file: [initramfs.cpio.gz](uploads/0076aa7cc5af1de25e286434187c296e/initramfs.cpio.gz)
|
|
|
|
|
|
7) Back up the original `image.ub` under `mzapo` and then create a new one with the new kernel by running `mkimage -f uboot-image.its image.ub`. This command is available from the `u-boot-tools` package.
|
|
|
|
... | ... | |