From patchwork Sat Jan 3 20:01:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 425126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 07FB61400B7 for ; Sun, 4 Jan 2015 07:01:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id BA53188E12; Sat, 3 Jan 2015 20:01:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k4alU-q7B4s5; Sat, 3 Jan 2015 20:01:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id DABD788B7D; Sat, 3 Jan 2015 20:01:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AFEC31BFA35 for ; Sat, 3 Jan 2015 20:01:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AA5FE89C62 for ; Sat, 3 Jan 2015 20:01:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E8xsV4svcYfV for ; Sat, 3 Jan 2015 20:01:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7EBCC87BEF for ; Sat, 3 Jan 2015 20:01:54 +0000 (UTC) Received: from linux.local ([188.99.115.174]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lrviw-1Xge490JAs-013cFy for ; Sat, 03 Jan 2015 21:01:51 +0100 From: Peter Seiderer To: buildroot@busybox.net Date: Sat, 3 Jan 2015 21:01:47 +0100 Message-Id: <1420315307-22645-1-git-send-email-ps.report@gmx.net> X-Mailer: git-send-email 2.1.2 X-Provags-ID: V03:K0:LgePjAcNBwGd0PiN3filMslTsE4mBjkIi8lUlnZpbtqCFL42rYU e6SUmKr/L2hqlew4Lb0JpLLbEvXkghyaoPjpKIX1XsGSEjPVPGsG5+mx73L3N5L4EN7YXS+ mNtUxpD0MBrbV1iH3gkT7b4qZOO61QvY+tYqWYQ2uWO3PLBCmaaXJaXIfBYfSFKyq2oMQwO mu3qLX3BNfjHzpKPqJCKg== X-UI-Out-Filterresults: notjunk:1; Subject: [Buildroot] [PATCH v3] linux: add fbtft kernel extension X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Tested with RaspberryPi B+ and PiTFT Mini Kit - 320x240 2.8" TFT (see [1] and [2]) and the following target configuration changes: - cmdline.txt: add 'fbcon=map:10 fbcon=font:VGA8x8' - add /etc/modules-load.d/fbtft.conf with 'fbtft_device' - add /etc/modprobe.d/00-fbtft.conf with 'options fbtft_device name=adafruit28 rotate=90 gpios=dc:25' [1] http://h65951.serverkompetenz.net/PeterSeiderer/upload/PiTFT_2_8_ct/Image9893.jpg [2] http://h65951.serverkompetenz.net/PeterSeiderer/upload/PiTFT_2_8_ct/Image9897.jpg Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - added missing linux/linux-ext-fbtft.mk file Changes v2 -> v3: - removed automatic kernel configurations changes - added kernel configuration hint to linux/Config.ext.in help text - added second installation directory for linux >= 3.15 --- linux/Config.ext.in | 25 +++++++++++++++++++++++++ linux/linux-ext-fbtft.mk | 41 +++++++++++++++++++++++++++++++++++++++++ package/Config.in | 1 + package/fbtft/Config.in | 13 +++++++++++++ package/fbtft/fbtft.mk | 11 +++++++++++ 5 files changed, 91 insertions(+) create mode 100644 linux/linux-ext-fbtft.mk create mode 100644 package/fbtft/Config.in create mode 100644 package/fbtft/fbtft.mk diff --git a/linux/Config.ext.in b/linux/Config.ext.in index 40c4684..c31628a 100644 --- a/linux/Config.ext.in +++ b/linux/Config.ext.in @@ -42,4 +42,29 @@ config BR2_LINUX_KERNEL_EXT_RTAI_PATCH help Optionally, explicitly specify the RTAI patch to use. +# fbtft +config BR2_LINUX_KERNEL_EXT_FBTFT + bool "fbtft patch" + select BR2_PACKAGE_FBTFT + help + Linux Framebuffer drivers for small TFT LCD display modules, + e.g. Adafruit PiTFT displays for Raspberry Pi. + + To enable fbtft, e.g. for Adafruit 2.8 PiTFT, enable the + following kernel configuarations: + - CONFIG_SPI: Device Drivers ---> SPI support + - CONFIG_SPI_BCM2708: Device Drivers ---> SPI support + ---> BCM2708 SPI controller driver + - CONFIG_GPIOLIB: Device Drivers ---> GPIO Support + - CONFIG_FB: Device Drives ---> Graphics support + ---> Support for frame buffer devices + - CONFIG_FB_TFT: Device Drivers ---> + Support for small TFT LCD display modules + - CONFIG_FB_TFT_ILI9341: Device Drivers ---> + Support for small TFT LCD display modules ---> + FB driver for the ILI9341 LCD Controller + or another FB_TFT submodule corresponding to your display. + + https://github.com/notro/fbtft + endmenu diff --git a/linux/linux-ext-fbtft.mk b/linux/linux-ext-fbtft.mk new file mode 100644 index 0000000..d555a3f --- /dev/null +++ b/linux/linux-ext-fbtft.mk @@ -0,0 +1,41 @@ +################################################################################ +# Linux fbtft extensions +# +# Patch the linux kernel with fbtft extension +################################################################################ + +ifeq ($(BR2_LINUX_KERNEL_EXT_FBTFT),y) +# Add dependency to fbtft package (download helper for the fbtft source) +LINUX_DEPENDENCIES += fbtft + +define FBTFT_PREPARE_KERNEL + # for linux >= 3.15 install to drivers/video/fbdev/fbtft + # for linux < 3.15 install to drivers/video/fbtft + if [ -e $(LINUX_DIR)/drivers/video/fbdev ]; then \ + mkdir $(LINUX_DIR)/drivers/video/fbdev/fbtft; \ + $(INSTALL) $(FBTFT_DIR)/*.h \ + $(FBTFT_DIR)/*.c \ + $(FBTFT_DIR)/Makefile \ + $(FBTFT_DIR)/Kconfig \ + $(FBTFT_DIR)/README \ + $(LINUX_DIR)/drivers/video/fbdev/fbtft; \ + echo 'source "drivers/video/fbdev/fbtft/Kconfig"' \ + >> $(LINUX_DIR)/drivers/video/fbdev/Kconfig; \ + echo 'obj-y += fbtft/' >> $(LINUX_DIR)/drivers/video/fbdev/Makefile; \ + else \ + mkdir $(LINUX_DIR)/drivers/video/fbtft; \ + $(INSTALL) $(FBTFT_DIR)/*.h \ + $(FBTFT_DIR)/*.c \ + $(FBTFT_DIR)/Makefile \ + $(FBTFT_DIR)/Kconfig \ + $(FBTFT_DIR)/README \ + $(LINUX_DIR)/drivers/video/fbtft; \ + echo 'source "drivers/video/fbtft/Kconfig"' \ + >> $(LINUX_DIR)/drivers/video/Kconfig; \ + echo 'obj-y += fbtft/' >> $(LINUX_DIR)/drivers/video/Makefile; \ + fi +endef + +LINUX_PRE_PATCH_HOOKS += FBTFT_PREPARE_KERNEL + +endif #BR2_LINUX_KERNEL_EXT_FBTFT diff --git a/package/Config.in b/package/Config.in index 3b37bb2..c658a28 100644 --- a/package/Config.in +++ b/package/Config.in @@ -311,6 +311,7 @@ endif source "package/evemu/Config.in" source "package/evtest/Config.in" source "package/fan-ctrl/Config.in" + source "package/fbtft/Config.in" source "package/fconfig/Config.in" source "package/fis/Config.in" source "package/flashrom/Config.in" diff --git a/package/fbtft/Config.in b/package/fbtft/Config.in new file mode 100644 index 0000000..eceea85 --- /dev/null +++ b/package/fbtft/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_FBTFT + bool "fbtft" + depends on BR2_LINUX_KERNEL + help + Linux Framebuffer drivers for small TFT LCD display modules, + e.g. Adafruit PiTFT displays for Raspberry Pi. + + This is only the download helper for the kernel patch. + + https://github.com/notro/fbtft + +comment "fbtft needs a Linux kernel to be built" + depends on !BR2_LINUX_KERNEL diff --git a/package/fbtft/fbtft.mk b/package/fbtft/fbtft.mk new file mode 100644 index 0000000..9f46bdb --- /dev/null +++ b/package/fbtft/fbtft.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# fbtft +# +################################################################################ + +FBTFT_VERSION = 274035404701245e7491c0c6471c5b72ade4d491 +FBTFT_SITE = $(call github,notro,fbtft,$(FBTFT_VERSION)) +FBTFT_LICENSE = GPLv2+ + +$(eval $(generic-package))