I recently acquired a IFC6410, a Qualcomm-based single board computer and decided to install Gentoo on it. There is some documentation available as part of the freedreno project. While this documentation was quite decent, I did run into some things that were not yet documented. This blog post will provide you will all the information to install Gentoo on the IFC6410 with the ability to get at least Network, X11 (HDMI), 3D and Audio working. As most of the instructions are quite generic, I hope the guide will be useful for those who prefer other distributions too.
The guide assumes that you have previous knowledge with Gentoo (or decent knowledge of Linux in general).
We will start by checking that you have the right tools for the job, both software and hardware. Software required will be covered in the guide when deemed necessary, so don't fear if you do not have, for example, fastboot installed.
Once we have verified you have the right tools, we will boot the device into the already-installed Android, to allow you to extract the firmware. (Although I plan to have the firmware available somewhere as well, but I am not sure if I can share it) The firmware can also be extracted without ever booting Android, but it's nice to see that the device boots up to something before you start hacking on it.
After that initial Android boot (which is optional), we will proceed with building a Linux kernel, creating a boot image using abootimg (compiled during this guide) and flash that image to the IFC6410. With the right boot parameters and a medium to boot from (with a base Gentoo install on it), we can boot to a working GNU/Linux. At this point it is also possible to extract the firmware from the Android image.
Once you have a working GNU/Linux, we will cover getting the hardware to actually do what you want by setting up the drivers properly. In most cases it may just work already, but ALSA (audio) may need some work, for example.
At the end of this guide you will hopefully have a working system with OpenGL 2.1, OpenGLES 2.0, working audio and network and more. I am currently using the IFC6410 as my primary desktop.
Follow instructions here to back up the firmware and to be able to boot a kernel with fastboot. We will build our own kernel, and then use the abootimg tool to create a kernel that the device can load.
This guide assumes you already have a cross compiler set up; if you don't have one (and are using Gentoo), setting one up is a breeze. Just make sure that crossdev is installed:
emerge crossdev -a
Then, once it is installed:
crossdev -S -t armv7a-hardfloat-linux-gnueabi
Clone the kernel and check out the ifc6410-drm branch:
git clone https://github.com/freedreno/kernel-msm/ git checkout -t origin/ifc6410-drm
Create the defconfig:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make ifc6410_rob_defconfig
Optionally change the kernel configuration:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make menuconfig
And then build the kernel:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make zImage modules CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm INSTALL_MOD_PATH=/root/ifc/mods make modules_install
We need to create a special image for the IFC to be able to boot our kernel.
First, extract Rob Clark's image:
wget http://people.freedesktop.org/%7Erobclark/f20/ifc6410-boot-f20.img ../abootimg/abootimg -x ifc6410-boot-f20.img
Assemble the boot image with your own kernel zImage and bootimg.cfg (just change "cmdline").
../abootimg/abootimg --create <image> -f bootimg.cfg -k zImage -r ../work/initrd.img
You don't need an initrd, but it looks like the tool refuses to create an image without it.
fastboot boot <image>
You can copy your kernel image to the device on-board storage, to have it boot your image by default. To do that, first resize the boot partition as in:
And then issue:
fastboot flash boot <image>
Unpack the stage3 to your favourite storage; can be a USB harddisk/stick or an MicroSD card. Set the serial in /etc/inittab to:
s0:12345:respawn:/sbin/agetty -L 115200 ttyHSL0 vt100
So far I have tested:
gentoo-ifc ~ # find /usr/share/alsa/ucm/apq8064-tabla-snd-card/ /usr/share/alsa/ucm/apq8064-tabla-snd-card/ /usr/share/alsa/ucm/apq8064-tabla-snd-card/Analog-stereo.conf /usr/share/alsa/ucm/apq8064-tabla-snd-card/apq8064-tabla-snd-card.conf /usr/share/alsa/ucm/apq8064-tabla-snd-card/Digital-stereo.conf
I often got "Corrupt MAC" when using rsync/ssh/scp/sftp. The following "fixed" it, but I cannot comment on the exact effect. (Checksums of large file transfers seem to be OK after this command though. Note that it is not persistent and likely a driver related issue. It happened on all my three IFC6410s.)
ethtool -K eth0 tx off