slitaz-arm rev 145

Add support to build fbtft enabled kernel and improve PiTFT flavor
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 29 23:34:32 2014 +0200 (2014-04-29)
parents 464a84405363
children c9e60d95bf34
files flavors/pitft/README flavors/pitft/rootfs/etc/X11/xorg.conf.d/99-calibration.conf flavors/pitft/rootfs/etc/init.d/local.sh flavors/pitft/rootfs/etc/modprobe.d/pitft.conf rpi/pitft/README rpi/pitft/cook-linux-fbtft.sh sat-rpi
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/flavors/pitft/README	Tue Apr 29 23:34:32 2014 +0200
     1.3 @@ -0,0 +1,21 @@
     1.4 +SliTaz PiTFT Touchscreen
     1.5 +------------------------
     1.6 +
     1.7 +SliTaz runs nicely on PiTFT! Here is a custom flavor to get started.
     1.8 +Cross compiling the fbtft kernel driver is done with:
     1.9 +
    1.10 +# sat-rpi cook-linux --clean --gconfig --fbtft 
    1.11 +
    1.12 +Then enable video drivers you want, close te config and it will buid.
    1.13 +The default X session is powered by sts.
    1.14 +
    1.15 +
    1.16 +Adafruit Fork of FBTFT for use with Adafruit TS shield
    1.17 +------------------------------------------------------
    1.18 +https://github.com/adafruit/adafruit-rpi-fbtft/
    1.19 +
    1.20 +
    1.21 +Adafruit guides
    1.22 +---------------
    1.23 +https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi
    1.24 +
     2.1 --- a/flavors/pitft/rootfs/etc/X11/xorg.conf.d/99-calibration.conf	Tue Apr 29 18:20:48 2014 +0200
     2.2 +++ b/flavors/pitft/rootfs/etc/X11/xorg.conf.d/99-calibration.conf	Tue Apr 29 23:34:32 2014 +0200
     2.3 @@ -1,6 +1,6 @@
     2.4  Section "InputClass"
     2.5 -	Identifier	"calibration"
     2.6 +	Identifier		"calibration"
     2.7  	MatchProduct	"stmpe-ts"
     2.8 -	Option	"Calibration"	"48 3692 3892 154"
     2.9 -	Option	"SwapAxes"	"1"
    2.10 +	Option			"Calibration"	"3692 48 154 3892"
    2.11 +	Option			"SwapAxes" "1"
    2.12  EndSection
     3.1 --- a/flavors/pitft/rootfs/etc/init.d/local.sh	Tue Apr 29 18:20:48 2014 +0200
     3.2 +++ b/flavors/pitft/rootfs/etc/init.d/local.sh	Tue Apr 29 23:34:32 2014 +0200
     3.3 @@ -6,6 +6,8 @@
     3.4  #
     3.5  
     3.6  echo "Setting up PiTFP screen..."
     3.7 +#modprobe fbtft_device debug=7 custom name=fb_ili9340 speed=16000000 \
     3.8 +#	rotate=90 gpios=dc:25 init=-1,0x01,-2,5,-1,0x28,-1,0xEF,0x03,0x80,0x02,-1,0xCF,0x00,0xC1,0x30,-1,0xED,0x64,0x03,0x12,0x81,-1,0xE8,0x85,0x00,0x78,-1,0xCB,0x39,0x2C,0x00,0x34,0x02,-1,0xF7,0x20,-1,0xEA,0x00,0x00,-1,0xC0,0x23,-1,0xC1,0x10,-1,0xC5,0x3e,0x28,-1,0xC7,0x86,-1,0x3A,0x55,-1,0xB1,0x00,0x18,-1,0xB6,0x08,0x82,0x27,-1,0xF2,0x00,-1,0x26,0x01,-1,0xE0,0x0F,0x31,0x2B,0x0C,0x0E,0x08,0x4E,0xF1,0x37,0x07,0x10,0x03,0x0E,0x09,0x00,-1,0xE1,0x00,0x0E,0x14,0x03,0x11,0x07,0x31,0xC1,0x48,0x08,0x0F,0x0C,0x31,0x36,0x0F,-1,0x11,-2,100,-1,0x29,-2,20,-3
     3.9  modprobe -v fbtft_device name=adafruitts rotate=90
    3.10  export FRAMEBUFFER=/dev/fb1
    3.11  startd slim
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/flavors/pitft/rootfs/etc/modprobe.d/pitft.conf	Tue Apr 29 23:34:32 2014 +0200
     4.3 @@ -0,0 +1,3 @@
     4.4 +# PiTFT kernel module options
     4.5 +
     4.6 +options fbtft_device name=adafruitts rotate=90
     5.1 --- a/rpi/pitft/README	Tue Apr 29 18:20:48 2014 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,19 +0,0 @@
     5.4 -SliTaz PiTFT Touchscreen
     5.5 -------------------------
     5.6 -
     5.7 -SliTaz runs nicely on PiTFT! Here are some notes about cross compiling the
     5.8 -fbtft kernel driver and about customization. The default X session is
     5.9 -powered by sts.
    5.10 -
    5.11 -Custom configs are in slitaz-arm/flavors/pitft
    5.12 -
    5.13 -
    5.14 -Adafruit Fork of FBTFT for use with Adafruit TS shield
    5.15 -------------------------------------------------------
    5.16 -https://github.com/adafruit/adafruit-rpi-fbtft/
    5.17 -
    5.18 -
    5.19 -Adafruit guides
    5.20 ----------------
    5.21 -https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi
    5.22 -
     6.1 --- a/rpi/pitft/cook-linux-fbtft.sh	Tue Apr 29 18:20:48 2014 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,54 +0,0 @@
     6.4 -#!/bin/sh
     6.5 -#
     6.6 -# Create SliTaz PiTFT Linux Kernel package
     6.7 -#
     6.8 -# See: https://github.com/adafruit/adafruit-rpi-fbtft/
     6.9 -#
    6.10 -. /lib/libtaz.sh
    6.11 -
    6.12 -cache="rpi/cache"
    6.13 -kvers="3.6.11"
    6.14 -tarball="linux-$kvers.tar.xz"
    6.15 -kurl="ftp://www.kernel.org/pub/linux/kernel/v3.x/$tarball"
    6.16 -install="$cache/linux-$vers-install"
    6.17 -: ${arch=arm}
    6.18 -
    6.19 -cd ${cache} || exit 1
    6.20 -
    6.21 -# Get source
    6.22 -echo "Checking for: $tarball"
    6.23 -[ -f "$tarball" ] || wget ${kurl}
    6.24 -[ -d "linux-$kvers" ] || tar xJf ${tarball}
    6.25 -cd linux-$kvers
    6.26 -
    6.27 -# FBtft drivers
    6.28 -if [ ! -d "drivers/video/fbtft" ]; then
    6.29 -	cd drivers/video
    6.30 -	git clone git://github.com/notro/fbtft.git
    6.31 -	cd ../..
    6.32 -	echo 'source "drivers/video/fbtft/Kconfig"' >> drivers/video/Kconfig
    6.33 -	echo 'obj-y += fbtft/' >> drivers/video/Makefile
    6.34 -fi
    6.35 -
    6.36 -export PATH=$PATH:/cross/${arch}/tools/bin
    6.37 -export HOST_SYSTEM=${arch}-slitaz-linux-gnueabi
    6.38 -
    6.39 -# Clean source and get config
    6.40 -#make mrproper &&
    6.41 -#cp -f ../../data/linux-pitft.config .config || exit 1
    6.42 -#yes "" | make ARCH=arm oldconfig
    6.43 -
    6.44 -# Handle --gconfig
    6.45 -[ "$gconfig" ] && make ARCH=arm gconfig
    6.46 -
    6.47 -# Cook it!
    6.48 -make ARCH=arm CROSS_COMPILE=${HOST_SYSTEM}- zImage &&
    6.49 -make ARCH=arm CROSS_COMPILE=${HOST_SYSTEM}- modules &&
    6.50 -make ARCH=arm CROSS_COMPILE=${HOST_SYSTEM}- \
    6.51 -	INSTALL_MOD_PATH=${install} modules_install || exit 1
    6.52 -mkdir -p ${install}/boot
    6.53 -cp -a arch/arm/boot/zImage ${install}/boot/kernel.img
    6.54 -
    6.55 -# Pack it!
    6.56 -
    6.57 -exit 0
     7.1 --- a/sat-rpi	Tue Apr 29 18:20:48 2014 +0200
     7.2 +++ b/sat-rpi	Tue Apr 29 23:34:32 2014 +0200
     7.3 @@ -52,6 +52,7 @@
     7.4    --nosat       Don't regenerate the distro with sat
     7.5    --nopatch     Don't patch the kernel before cooking
     7.6    --gconfig     Configure the kernel before cooking
     7.7 +  --fbtft       Try to compile the Framebuffer touch screen driver
     7.8  
     7.9  EOT
    7.10  }
    7.11 @@ -216,12 +217,22 @@
    7.12  			error "Missing cross toolchain in: /cross/$arch" && exit 1
    7.13  		fi
    7.14  		
    7.15 -		# Kernel source
    7.16 +		# Kernel source and --clean
    7.17  		mkdir -p ${rpi_git} && cd ${rpi_git}
    7.18  		[ -d "$kernel" ] || git clone --depth 1 ${rpi_git_url}linux.git
    7.19 +		[ "$clean" ] && rm -rf ${install}
    7.20 +		
    7.21 +		# FBtft drivers for small touchscreen such PiTFT, PiScreen
    7.22 +		if [ "$fbtft" ] && [ ! -d "${kernel}/drivers/video/fbtft" ]; then
    7.23 +			cd ${kernel}/drivers/video
    7.24 +			git clone git://github.com/notro/fbtft.git
    7.25 +			cd ${kernel}
    7.26 +			echo 'source "drivers/video/fbtft/Kconfig"' >> drivers/video/Kconfig
    7.27 +			echo 'obj-y += fbtft/' >> drivers/video/Makefile
    7.28 +			cd ${rpi_git}
    7.29 +		fi
    7.30  		
    7.31  		# Compile
    7.32 -		[ "$clean" ] && rm -rf ${install}
    7.33  		if [ ! -d "$install" ]; then
    7.34  			cd ${kernel}
    7.35  			export PATH=$PATH:/cross/${arch}/tools/bin
    7.36 @@ -257,11 +268,13 @@
    7.37  		depmod -b . ${kvers%+}-tazberry+
    7.38  		
    7.39  		# Kernel
    7.40 -		fs="$cache/linux-$kvers/fs"
    7.41 +		pkg="linux"
    7.42 +		[ "$fbtft" ] && pkg="linux-fbtft"
    7.43 +		fs="$cache/$pkg-$kvers/fs"
    7.44  		echo "Kernel version: $kvers"
    7.45  		if [ -d "$install" ]; then
    7.46 -			rm -rf ${cache}/linux-${kvers}
    7.47 -			mkdir -p ${cache}/linux-${kvers}
    7.48 +			rm -rf ${cache}/${pkg}-${kvers}
    7.49 +			mkdir -p ${cache}/${pkg}-${kvers}
    7.50  			cp -a ${install} ${fs}
    7.51  			rm -f ${fs}/lib/modules/*/build \
    7.52  				${fs}/lib/modules/*/source
    7.53 @@ -270,16 +283,16 @@
    7.54  		# Pack .tazpkg
    7.55  		cd ${cache}
    7.56  		echo "Creating package: receipt"
    7.57 -		cat > linux-$kvers/receipt << EOT
    7.58 +		cat > ${pkg}-$kvers/receipt << EOT
    7.59  # SliTaz package receipt
    7.60  
    7.61 -PACKAGE="linux"
    7.62 +PACKAGE="${pkg}"
    7.63  VERSION="$kvers"
    7.64  SHORT_DESC="SliTaz GNU/Linux Kernel for the Raspberry Pi."
    7.65  WEB_SITE="http://www.kernel.org"
    7.66  
    7.67  EOT
    7.68 -		tazpkg pack linux-$kvers ;;
    7.69 +		tazpkg pack ${pkg}-$kvers ;;
    7.70  	
    7.71  	clone-fw)
    7.72  		clone_fw ;;