Linux earlyprintk/earlycon support on ARM

The serial console is a very helpful debugging tool for kernel development. However, when a crash occurs early in the boot process, one is left in the dark. There are two early console implementations available with different merits. This post will throw some lights on them.

earlyprintk

The kernel supports earlyprintk since… probably ever. At least 2.6.12, where the new age (git) started. After enabling “Kernel low-level debugging”, “Early printk” under “Kernel hacking” and selecting an appropriate low-level debugging port, you are ready to get early serial console output. Continue reading “Linux earlyprintk/earlycon support on ARM”

Debug IPv6 issues on OpenWrt

My new provider IPv6 connectivity, however after connecting my OpenWrt based WNDR4300 (using Chaos Calmer 15.05-rc3) things unfortunately did not “just work”… This post summarize some hints how to debug IPv6 on OpenWrt.

First, make sure that the upstream (WAN) interface is configured according to the documentation in the OpenWrt Wiki. Using LuCI, you have to create a new interface (WAN6) which should c

If your ISP provides IPv6 support, it should “just work” at this point. However, what to do if not? Continue reading “Debug IPv6 issues on OpenWrt”

Cross compile Linux for ARM using LLVM/clang on Arch Linux

The LLVMLinux team made quite some progress in enabling LLVM/clang to build the Linux kernel. There has also been a talk at the Collaboration Summit 2015 in Santa Rosa (slides). So I thought, give it a try and compile a kernel for my ARM based board of choice. The upstream kernel.org Linux kernel is not yet ready to be built using LLVM/clang, some patches are still required. Therefor I used the kernel from the LLVMLinux git server.

The nice thing about LLVM/clang is that it supports multiple targets. The binaries provided by the Arch repositories support several ARM targets:

$ pacman -S clang
...
$ llc --version
LLVM (http://llvm.org/):
 LLVM version 3.5.1
 Optimized build.
 Built Jan 14 2015 (03:18:15).
 Default target: x86_64-unknown-linux-gnu
 Host CPU: core-avx-i

 Registered Targets:
 aarch64 - AArch64 (little endian)
 aarch64_be - AArch64 (big endian)
 arm - ARM
 arm64 - AArch64 (little endian)
 arm64_be - AArch64 (big endian)
 armeb - ARM (big endian)
...

Continue reading “Cross compile Linux for ARM using LLVM/clang on Arch Linux”