pitft: Add basic support for PiTFT

Add basic support for PiTFT display by using device-trees.

In order get it working below configurations must be active in
local.conf:

MACHINE_FEATURES += "pitft"
 - This will enable SPI bus and i2c device-trees, it will also setup
   framebuffer for console and x server on PiTFT.

[Support #70]

Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
This commit is contained in:
Petter Mabäcker
2016-02-28 14:46:12 +01:00
committed by Andrei Gherzan
parent 52671faf4f
commit 0d5aff5161
5 changed files with 36 additions and 5 deletions
+13
View File
@@ -28,6 +28,7 @@ Contents:
3.K. Device tree support 3.K. Device tree support
3.L. Enable SPI bus 3.L. Enable SPI bus
3.M. Enable I2C 3.M. Enable I2C
3.N. Enable PiTFT support
4. Extra apps 4. Extra apps
4.A. omxplayer 4.A. omxplayer
5. Board Configuration 5. Board Configuration
@@ -213,6 +214,18 @@ ENABLE_SPI_BUS = "1"
When using device tree kernels, set this variable to enable I2C When using device tree kernels, set this variable to enable I2C
ENABLE_I2C = "1" ENABLE_I2C = "1"
3.N. Enable PiTFT support
=========================
Basic support for using PiTFT screens can be enabled by adding
below in local.conf:
MACHINE_FEATURES += "pitft"
- This will enable SPI bus and i2c device-trees, it will also setup
framebuffer for console and x server on PiTFT.
NOTE: To get this working the overlay for the PiTFT model must be build,
added and specified as well (dtoverlay=<driver> in config.txt)
4. Extra apps 4. Extra apps
============= =============
+4 -2
View File
@@ -15,6 +15,8 @@ S = "${WORKDIR}/git"
PR = "r4" PR = "r4"
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
inherit deploy inherit deploy
do_deploy() { do_deploy() {
@@ -71,12 +73,12 @@ do_deploy() {
fi fi
# SPI bus support # SPI bus support
if [ -n "${ENABLE_SPI_BUS}" ]; then if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then
echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
fi fi
if [ -n "${ENABLE_I2C}" ]; then if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then
echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
@@ -0,0 +1,5 @@
Section "Device"
Identifier "Adafruit PiTFT"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
@@ -1,10 +1,17 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf " SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \
file://xorg.conf.d/99-pitft.conf \
"
do_install_append_rpi () { do_install_append_rpi () {
install -d ${D}/${sysconfdir}/X11/xorg.conf.d/ install -d ${D}/${sysconfdir}/X11/xorg.conf.d/
install -m 0644 ${WORKDIR}/xorg.conf.d/* ${D}/${sysconfdir}/X11/xorg.conf.d/ install -m 0644 ${WORKDIR}/xorg.conf.d/10-evdev.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
if [ "${PITFT}" = "1" ]; then
install -m 0644 ${WORKDIR}/xorg.conf.d/99-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
fi
} }
FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*" FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*"
+5 -1
View File
@@ -53,7 +53,11 @@ do_install_prepend() {
do_deploy_append() { do_deploy_append() {
# Deploy cmdline.txt # Deploy cmdline.txt
install -d ${DEPLOYDIR}/bcm2835-bootfiles install -d ${DEPLOYDIR}/bcm2835-bootfiles
echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
if [ ${PITFT} = "1" ]; then
PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
fi
echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
} }
do_rpiboot_mkimage() { do_rpiboot_mkimage() {