For several months I’ve been treying to find my way to embedded Linux programming.
My hardware set was very limited, I had only one board that can be called
“embedded” and it was Raspberry Pi. Because I am more interested in firmware/OS
level then hardware I tried to figure out what is going on with RPi kernel.
After taking a brief review of
raspberrypi/linux GitHub repository I
realized that close to my heart is an upstreaming effort. So with noob attitude I
contacted RPi Upstreaming wiki page author (notro)
and we started to create some foundation.
Disclaimer: These are for testing purposes and considered unstable. Use at your own risk.
Edit: 20/10/2014: minor typo, clone instructions moved to “How to use it ?” section
What we have now?
We created a set of repositories to handle the upstreaming process.
First there is rpi-dt-linux
it is Linux kernel based on
with patches on top of every branch. This repository aims to aggregate all
patches required for Raspberry Pi support in the upstream kernel.
bcm2835_defconfig with device tree support. We want to introduce every
driver that supports device tree. Right now a lot of stuff is missing, but I
will dive into it later.
After consulting with
popcornmix we decide to
rebase all patches to keep them on top of every branch. This, of course, means
that repository will be broken, but patches will be more visible in history.
Second rpi-dt-firmware is ready
to use firmware files for Raspberry Pi with already built modules and kernel.
If you are familiar with Hexxeh
rpi-update and his repository
rpi-firmware this should not be
anything new for you.
Third rpi-bcm2835 which simplifies
build and release process of
How to use it?
If you simply want to try new kernel on your RPi then install
sudo apt-get install rpi-update
on Raspbian or follow instruction from
Readme.md for other distributions.
To install latest release of
rpi-update on RPi:
sudo REPO_URI=https://github.com/pietrushnic/rpi-dt-firmware rpi-update
After update simply reboot your Pi and enjoy our upstream kernel :).
If you want to play with the code I have few hints that can help.
First please clone
rpi-bcm2835 mentioned above.
git clone https://github.com/pietrushnic/rpi-dt-linux.git
git clone https://github.com/notro/rpi-bcm2835.git
Then install rpi-build following
instructions on wiki. Then you can
do few things:
rpi-dt-linux locally. This will download the latest snapshot of
rpi-dt-linux and other dependencies like
u-boot and cross-compiler.
rpi-build rpi-dt-linux clean build
You can install already built kernel on your machine over ssh (replace
<RPI_IP> with your Pi IP address):
rpi-build rpi-dt-linux install SSHIP=<RPI_IP>
If you want to use your own kernel repository just use
rpi-bcm2835 with local
RPI_DT_LINUX_LOCAL=../../rpi-dt-linux rpi-build rpi-dt-linux clean build
NOTE: that additional level of
../ was added because rpi-build creates
workdir which is reference directory for it.
It is also possible to release your own firmware repository. To help with
the process there are two commands:
FW_REPO=/home/pietrushnic/src/rpi-dt-firmware FW_BRANCH=master rpi-build rpi-dt-linux commit
FW_REPO=/home/pietrushnic/src/rpi-dt-firmware FW_BRANCH=master rpi-build rpi-dt-linux push
FW_REPO is a directory with firmware git repository.
At the point of writing this post, there were 3 releases of
applied v10 of mailbox API and Lubomir
bcm2835-thermal drivers from his
All updates are published in
with every release.
Of course, we are happy with every contribution small and big, critique and
process improvement hints. Let us know what you think about this effort.