Articles

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
Booting a BSP kernel on the rock960 board Before hacking the board, I want to evaluate it and for this, a kernel supporting the board is needed. Hopefully there is a full debian image with a 4.4 kernel  available at varms.com. The image partitions layout is described on the 96boards web site . I prefer to use the SD card to install the system. As my console is setup, I can simply power up the board with the micro SD card inserted in and see what happens. After a few seconds, I have a prompt :) The kernel version is  4.4.103 , debian is 9.2 Supported features Network Wifi was not tested but it appears to work for the "iwlist scanning" with some warnings "wl_escan_handler : escan is not ready ndev" The ethernet - USB adapter with an asix AX88772B is detected and the network works fine Power management The idle states are managed through PSCI, there are three states (WFI, cpu sleep and cluster sleep), the characteristics for each cluster are
Image
The 96boards - rock960 My goals with this board The rock960  showed interesting technical characteristics, I wanted to acquire this board and have fun. The decision to spend some money on this board was greatly influenced by the upstream support. It may not be complete but I know Heiko Stubner, maintainer of the rockchip platform, is doing a great job so it would be a question of time before having all the bits supported mainstream. My goal is to have this board working with an upstream kernel, if it is close to full support, I'm perfectly fine to contribute and bring my stone to the edifice. Ordering the board There are two versions of this board, a light one with 2GB of memory and 16GB of eMMC and a stronger one with 4GB of memory and 32GB of eMMC. I choose the later because, by experience, advanced benchmarking programs often blow memory and are impossible to run on a 2GB system without triggering the Out-Of-Memory killer (swap is not an option for obvious reason