diff options
| author | Petter Mabäcker <petter@technux.se> | 2016-02-28 14:46:12 +0100 |
|---|---|---|
| committer | Andrei Gherzan <andrei@gherzan.ro> | 2016-03-01 14:38:03 +0100 |
| commit | 0d5aff5161d0fb6f91bc9021f86065248cd8cd1b (patch) | |
| tree | 001df2131591ac7916acda8cebbb4646cb2e25a0 | |
| parent | 52671faf4fd26db008a77f9815fb29c088b29cea (diff) | |
| download | meta-raspberrypi-0d5aff5161d0fb6f91bc9021f86065248cd8cd1b.tar.gz | |
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>
| -rw-r--r-- | README | 13 | ||||
| -rw-r--r-- | recipes-bsp/bootfiles/rpi-config_git.bb | 6 | ||||
| -rw-r--r-- | recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf | 5 | ||||
| -rw-r--r-- | recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | 11 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-raspberrypi.inc | 6 |
5 files changed, 36 insertions, 5 deletions
| @@ -28,6 +28,7 @@ Contents: | |||
| 28 | 3.K. Device tree support | 28 | 3.K. Device tree support |
| 29 | 3.L. Enable SPI bus | 29 | 3.L. Enable SPI bus |
| 30 | 3.M. Enable I2C | 30 | 3.M. Enable I2C |
| 31 | 3.N. Enable PiTFT support | ||
| 31 | 4. Extra apps | 32 | 4. Extra apps |
| 32 | 4.A. omxplayer | 33 | 4.A. omxplayer |
| 33 | 5. Board Configuration | 34 | 5. Board Configuration |
| @@ -213,6 +214,18 @@ ENABLE_SPI_BUS = "1" | |||
| 213 | When using device tree kernels, set this variable to enable I2C | 214 | When using device tree kernels, set this variable to enable I2C |
| 214 | ENABLE_I2C = "1" | 215 | ENABLE_I2C = "1" |
| 215 | 216 | ||
| 217 | 3.N. Enable PiTFT support | ||
| 218 | ========================= | ||
| 219 | Basic support for using PiTFT screens can be enabled by adding | ||
| 220 | below in local.conf: | ||
| 221 | |||
| 222 | MACHINE_FEATURES += "pitft" | ||
| 223 | - This will enable SPI bus and i2c device-trees, it will also setup | ||
| 224 | framebuffer for console and x server on PiTFT. | ||
| 225 | |||
| 226 | NOTE: To get this working the overlay for the PiTFT model must be build, | ||
| 227 | added and specified as well (dtoverlay=<driver> in config.txt) | ||
| 228 | |||
| 216 | 229 | ||
| 217 | 4. Extra apps | 230 | 4. Extra apps |
| 218 | ============= | 231 | ============= |
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 138cb37..bfe00d1 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb | |||
| @@ -15,6 +15,8 @@ S = "${WORKDIR}/git" | |||
| 15 | 15 | ||
| 16 | PR = "r4" | 16 | PR = "r4" |
| 17 | 17 | ||
| 18 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" | ||
| 19 | |||
| 18 | inherit deploy | 20 | inherit deploy |
| 19 | 21 | ||
| 20 | do_deploy() { | 22 | do_deploy() { |
| @@ -71,12 +73,12 @@ do_deploy() { | |||
| 71 | fi | 73 | fi |
| 72 | 74 | ||
| 73 | # SPI bus support | 75 | # SPI bus support |
| 74 | if [ -n "${ENABLE_SPI_BUS}" ]; then | 76 | if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then |
| 75 | echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 77 | echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 76 | echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 78 | echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 77 | fi | 79 | fi |
| 78 | 80 | ||
| 79 | if [ -n "${ENABLE_I2C}" ]; then | 81 | if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then |
| 80 | echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 82 | echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 81 | echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 83 | echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 82 | echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 84 | echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf b/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf new file mode 100644 index 0000000..0d2b36b --- /dev/null +++ b/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | Section "Device" | ||
| 2 | Identifier "Adafruit PiTFT" | ||
| 3 | Driver "fbdev" | ||
| 4 | Option "fbdev" "/dev/fb1" | ||
| 5 | EndSection | ||
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend index 2cf40f8..0ae2ee0 100644 --- a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend +++ b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | |||
| @@ -1,10 +1,17 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 2 | 2 | ||
| 3 | SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf " | 3 | SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \ |
| 4 | file://xorg.conf.d/99-pitft.conf \ | ||
| 5 | " | ||
| 4 | 6 | ||
| 5 | do_install_append_rpi () { | 7 | do_install_append_rpi () { |
| 6 | install -d ${D}/${sysconfdir}/X11/xorg.conf.d/ | 8 | install -d ${D}/${sysconfdir}/X11/xorg.conf.d/ |
| 7 | install -m 0644 ${WORKDIR}/xorg.conf.d/* ${D}/${sysconfdir}/X11/xorg.conf.d/ | 9 | install -m 0644 ${WORKDIR}/xorg.conf.d/10-evdev.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ |
| 10 | |||
| 11 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" | ||
| 12 | if [ "${PITFT}" = "1" ]; then | ||
| 13 | install -m 0644 ${WORKDIR}/xorg.conf.d/99-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ | ||
| 14 | fi | ||
| 8 | } | 15 | } |
| 9 | 16 | ||
| 10 | FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*" | 17 | FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*" |
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 5a8a175..4f59c97 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc | |||
| @@ -53,7 +53,11 @@ do_install_prepend() { | |||
| 53 | do_deploy_append() { | 53 | do_deploy_append() { |
| 54 | # Deploy cmdline.txt | 54 | # Deploy cmdline.txt |
| 55 | install -d ${DEPLOYDIR}/bcm2835-bootfiles | 55 | install -d ${DEPLOYDIR}/bcm2835-bootfiles |
| 56 | echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt | 56 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" |
| 57 | if [ ${PITFT} = "1" ]; then | ||
| 58 | PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" | ||
| 59 | fi | ||
| 60 | echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt | ||
| 57 | } | 61 | } |
| 58 | 62 | ||
| 59 | do_rpiboot_mkimage() { | 63 | do_rpiboot_mkimage() { |
