Articles

Affichage des articles du décembre, 2018

Custom kernel compilation

Compilation of the upstream kernel Yes, I'm serious, the rock960 is supported mainline (without the graphics obviously). Well to be exact, all the bits are in the soc maintainer tree and will be merged for 4.21. But until then, you should use the arm-soc tree, or mmind tree with the for-next branch (Dec, 22 2018). Build the kernel:    make ARCH=arm64 menuconfig    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 12 Image dtbs Generate the image: Create the configuration file  rock960-rk3399-kernel.its with the following content: /dts-v1/; / { description = "Mainline kernel image with one or more FDT blobs"; #address-cells = <1>; images { kernel@1 { description = "Mainline kernel"; data = /incbin/("./arch/arm64/boot/Image"); type = "kernel"; arch = "arm64"; os = "linux"; /* load = <0x2080000>; entry = <0x2080000>; */ load =
Setting the u-boot and ftpboot The u-boot is configured to download a freshly new compiled kernel on a server and boot it. So the server must be setup with dnsmasq to provide dhcp and tftpboot. Here is the configuration file for dnsmasq.conf: enable-tftp tftp-root=<path-to-your-build-dir> dhcp-boot=vmlinux interface=eth0 As the board does not embbed a network card, I use an USB-ethernet adapter based on ASIX which is largely supported and very cheap (note I bought a bunch of these adapters and *one* apple adapter very expensive, this one is dead while the others cheap manufactured adapters work like a charm). Keywords for aliexpress "Asix AX8872B", "USB", "2.0', "RJ45". So to make it simple, here is the printenv: red : added commands blue : renamed commands black : defauts commands rock960 => printenv arch=arm baudrate=1500000 board=rock960_rk3399 board_name=rock960_rk3399 boot_a_script=lo
Updating u-boot Kernel hacking implies a lot of iterative small changes followed by a deployment on the board, that  become really annoying if we have to switch the SD card from the board to the computer in order to copy the kernel and put it back to the board again, without speaking about the degradation of the SD card adapter by these multiple mechanical operations. A solution is to have u-boot to download the kernel directly from the compilation host. I used to have tftpboot loading the kernel and the dtb. For this, we need an u-boot supporting the rock960 and hopefully the upstream support is almost ready (patches are submitted and very likely they will be merged soon 09-26-2018). In addition an USB dongle with ASIX chipset must be used (it is the one I'm used to have), you can find this with the following keywords over internet : USB 2.0 RJ45 Lan Ethernet Asix AX8872B Until we have those patches merged, this is the quick summary of what is needed to compile u-boot for