MoritzS
Posts: 2
Joined: Wed Jan 28, 2015 3:33 pm

Upstream Kernel Compilation, no USB on B+

Thu Jan 29, 2015 1:32 pm

Dear All,

for a research project I needed to compile an upstream linux kernel for the Raspberry Pi. (I want to use the RasPi with the AT86RF2xx series IEEE 802.15.4 wireless transceivers. The bluetooth-next linux branch contains source code for them.) I would like to summarize my findings here.

I took http://elinux.org/RPi_Upstream_Kernel_Compilation as a guide. That guide however seems to be written for the B instead of the B+ (so I ended up extending it).

======Make .config Files=======
From all the different possibilities of obtaining a .config file, only the bcm2835_defconfig one worked (under arch/arm/configs/). All config files created from bcmrpi_[ cutdown | emergency | quick ]_defconfig files gave me a non-booting kernel. Config files pulled from /proc/config.gz from a booting precompiled rasbian kernel showed the same behaviour.


======Device Tree Files=======
I am somewhat confused about the different Device Tree (.dts / .dtb) files:
a) My U-Boot Bootloader expects "bcm2835-rpi-b-plus.dtb" as the name of the Device Tree File even though I specified bcm2835-rpi-b.dtb in boot.scr. However https://github.com/raspberrypi/firmware ... aster/boot only shows bcm2708-rpi-b[-plus].dtb This may be because U-Boot seems to not properly pass hardware info to the kernel

b) My kernel compilation gives me three different dtb files under arch/arm/boot/dts:
bcm2708-rpi-b-plus.dtb.
bcm2835-rpi-b.dtb and
bcm2835-rpi-b-plus.dtb
Additionally one could use the dtb files from the repository linked above.
Only the self-compiled bcm2835-rpi-b.dtb works! All other Device Tree Files get stuck during boot at "Calibrating delay loop" or you end up without the SMSC LAN9514, so without USB and Ethernet.

So, long story short, to compile upstream kernels for the Raspberry Pi B+, you need to
  • * use bcm2835_defconfig to prime your .config file
    * do the additional configuring via menuconfig that suits you most
    * add the self-built bcm2835-rpi-b-plus.dtb from arch/arm/boot/dts to the boot folder, either modify boot.scr accordingly or rename the dtb file to suit the expected name

ross
Posts: 13
Joined: Fri Aug 26, 2011 8:18 pm

Re: Upstream Kernel Compilation, no USB on B+

Thu Jan 29, 2015 4:16 pm

Glad that you managed to find a working combination of options.

I thought that I would add another reason why USB might not work when using the the bcm2835_defconfig in case somebody else tries to reproduce this

Unlike the Foundation's "bcm2708" platform the upstream "bcm2835" does not switch on the USB PHY. So to get USB (and therefore ethernet) working you need to rely on a patch to U-Boot - http://lists.denx.de/pipermail/u-boot/2 ... 67836.html - that actually turns on the USB PHY before launching the kernel.

RDroms
Posts: 1
Joined: Mon Apr 20, 2015 1:16 pm

Re: Upstream Kernel Compilation, no USB on B+

Mon Apr 20, 2015 1:18 pm

Has anyone successfully built an upstream kernel, preferably bluetooth-next for the Raspberry Pi 2?

Return to “Advanced users”