Build fbtft drivers for TI Linux 4.1 kernel
Build fbtft drivers for TI Linux 4.1 kernel so that BeagleBone Black can use TFT LCD connected via SPI as Framebuffer
Texas Instruments has their own Linux kernel repo with branches to support their processors such as the Sitara AM3358 in the BeagleBone Black:
[email protected]: ti-linux-kernel
Here is a good presentation for TI TechDay 2015 on how TI handles Linux engineering.
The most excellent Robert C. Nelson has made it very easy to run TI kernels on your BeagleBone Black by using his ti-linux-kernel-dev repo. The newest branch is ti-linux-4.1.y. While current kernel.org stable is 4.3, TI is working on 4.1 as it is current Long Term Support (LTS) kernel. Linux 4.4 is expected to be released at the end of the year, and that will become the new LTS kernel. I believe TI will then move forward to that.
A big advantage of moving to Linux 4.1 is that the fbtft drivers are now in the Linux kernel: drivers/staging/fbtft. Last December, Thomas Petazzoni of Free Electrons took it upon himself to add notro's fbtft drivers to the kernel: [PATCH 00/29] staging: add drivers from the fbtft project. Development in notro's repo has ceased and moved to the Linux kernel drivers staging tree. fbtft is maintained by Noralf Trønnes (notro) & Thomas Petazzoni.
Here are the steps that I followed. Full transcript is in my GitHub Gist.
Step 1: Build kernel
These commands were on my 64-bit Intel laptop running Debian GNU/Linux 8.2:
After running for awhile, build_kernel.sh will invoke the kernel config menu. Enable the fbtft modules located in the Device Drivers -> Staging menu. Here are photos of kernel config menus:
Step 2: Flash SD card
Flash a Debian 8.2 (Jessie) Snapshot console image from the BeagleBoneBlack Debian page on the eLinux.org wiki:
Step 3: Install new kernel
Re-insert SD card so that its filesystem is mounted. Run the kernel install script from yourti-linux-kernel-dev directory:
Unmount and eject the SD card:
Insert SD card into BeagleBone Black and boot it.
The install script fails to do the following so it must be done manually. Copy the kernel image and device tree bindings to the expected location:
Edit /boot/uEnv.txt to set uname_r=4.1.13-ti-r30 and set dtb=am335x-boneblack-overlay.dtb:
Run script to grow filesystem to make use of the SD cards full capacity:
Reboot the BeagleBone:
bone$ sudo reboot
After rebooting, verify that the new kernel is running:
Step 4: Enable SPI
Now build & install the latest Device Tree Overlays from bb.org-overlays repo:
Enable the spi1 peripheral (which LCD is wired up to) by loading the BB-SPIDEV1 Device Tree overlay:
Step 5: Load fbtft driver
Load the fbtft_device kernel module for adafruit18 (Adafruit 1.8" TFT LCD) which will then load the fb_st7735r driver:
Install fbi to display image on the LCD:
Projected created on: Wed Dec 02 2015 01:26:19 GMT-0000 (UTC)
Submitted by: pdp7.blogspot.com
Last updated on: Wed Dec 02 2015 01:26:19 GMT-0000 (UTC)