Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv into openelec-6.0

This commit is contained in:
Stephan Raue 2015-06-09 14:27:35 +02:00
commit 2678e6d973
84 changed files with 42181 additions and 6356 deletions

View File

@ -1,3 +1,5 @@
6.0.1
update driver for new devices support
6.0.0
rebuild for OpenELEC-6.0
4.3.4

View File

@ -18,7 +18,7 @@
PKG_NAME="sundtek-mediatv"
PKG_VERSION="6.0"
PKG_REV="0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="nonfree"
PKG_SITE="http://support.sundtek.com/"

View File

@ -17,12 +17,12 @@
################################################################################
PKG_NAME="cmake"
PKG_VERSION="3.0.2"
PKG_VERSION="3.2.3"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="BSD"
PKG_SITE="http://www.cmake.org/"
PKG_URL="http://www.cmake.org/files/v3.0/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_URL="http://www.cmake.org/files/v3.2/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="ccache:host"
PKG_PRIORITY="optional"
PKG_SECTION="toolchain/devel"
@ -36,6 +36,9 @@ configure_host() {
../configure --prefix=$ROOT/$TOOLCHAIN \
--no-qt-gui --no-system-libs \
-- \
-DCMAKE_C_FLAGS="-O2 -Wall -pipe -Wno-format-security" \
-DCMAKE_CXX_FLAGS="-O2 -Wall -pipe -Wno-format-security" \
-DCMAKE_EXE_LINKER_FLAGS="$HOST_LDFLAGS" \
-DBUILD_CursesDialog=0
}

View File

@ -54,7 +54,6 @@ configure_target() {
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
-DBUILD_SHARED_LIBS=1 \
-DSKIP_PYTHON_WRAPPER:STRING=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_INSTALL_LIBDIR_NOARCH=/usr/lib \
@ -63,3 +62,7 @@ configure_target() {
$EXTRA_CMAKE_OPTS \
..
}
post_makeinstall_target() {
mv $INSTALL/usr/lib/python2.7/dist-packages $INSTALL/usr/lib/python2.7/site-packages
}

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="bcm2835-driver"
PKG_VERSION="70b0598"
PKG_VERSION="4d961a6"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="nonfree"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="libpng"
PKG_VERSION="1.6.16"
PKG_VERSION="1.6.17"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="mesa"
PKG_VERSION="10.6.0-rc1"
PKG_VERSION="10.6.0-rc3"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="iwlwifi-firmware"
PKG_VERSION="0.0.1"
PKG_VERSION="0.0.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="misc-firmware"
PKG_VERSION="0.0.13"
PKG_VERSION="0.0.14"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="wlan-firmware"
PKG_VERSION="0.0.28"
PKG_VERSION="0.0.29"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -40,7 +40,7 @@ case "$LINUX" in
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET imx6-status-led imx6-soc-fan"
;;
*)
PKG_VERSION="4.0.4"
PKG_VERSION="4.0.5"
PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz"
;;
esac
@ -155,14 +155,11 @@ makeinstall_target() {
done
elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then
mkdir -p $INSTALL/usr/share/bootloader/overlays
touch $INSTALL/usr/share/bootloader/overlays/README.TXT
for dtb in arch/arm/boot/dts/*.dtb; do
if `echo "$dtb" | grep ".*/bcm2[^/]*$" >/dev/null`; then
cp $dtb $INSTALL/usr/share/bootloader 2>/dev/null || :
else
cp $dtb $INSTALL/usr/share/bootloader/overlays 2>/dev/null || :
fi
cp -p arch/arm/boot/dts/*.dtb $INSTALL/usr/share/bootloader
for dtb in arch/arm/boot/dts/overlays/*.dtb; do
cp $dtb $INSTALL/usr/share/bootloader/overlays 2>/dev/null || :
done
cp -p arch/arm/boot/dts/overlays/README $INSTALL/usr/share/bootloader/overlays
fi
}

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="OpenELEC-settings"
PKG_VERSION="0.6.6"
PKG_VERSION="0.6.7"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="prop."

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="audioencoder.flac"
PKG_VERSION="84acb14"
PKG_VERSION="a5e2d12"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="audioencoder.lame"
PKG_VERSION="3eb59de"
PKG_VERSION="b283cd5"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="audioencoder.vorbis"
PKG_VERSION="d556a68"
PKG_VERSION="15d619d"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="audioencoder.wav"
PKG_VERSION="40aaedf"
PKG_VERSION="797c990"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="kodi-theme-Confluence"
PKG_VERSION="15.0-beta2-c34fc22"
PKG_VERSION="15.0-beta2-81a115b"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="kodi"
PKG_VERSION="15.0-beta2-c34fc22"
PKG_VERSION="15.0-beta2-81a115b"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
@ -341,8 +341,8 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/bin/xbmc-standalone
rm -rf $INSTALL/usr/lib/kodi/*.cmake
# fix binaryaddons multiarch build meh
cp -P project/cmake/scripts/linux/UseMultiArch.cmake $SYSROOT_PREFIX/usr/lib/kodi
# more binaddons cross compile badness meh
sed -i -e "s:INCLUDE_DIR /usr/include/kodi:INCLUDE_DIR $SYSROOT_PREFIX/usr/include/kodi:g" $SYSROOT_PREFIX/usr/lib/kodi/kodi-config.cmake
mkdir -p $INSTALL/usr/lib/kodi
cp $PKG_DIR/scripts/kodi-config $INSTALL/usr/lib/kodi

View File

@ -17,12 +17,13 @@
################################################################################
PKG_NAME="libva-intel-driver"
PKG_VERSION="1.5.1"
PKG_VERSION="1.6.0.pre1"
PKG_REV="1"
PKG_ARCH="x86_64"
PKG_LICENSE="GPL"
PKG_SITE="http://freedesktop.org/wiki/Software/vaapi"
PKG_URL="http://www.freedesktop.org/software/vaapi/releases/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2"
#PKG_URL="http://www.freedesktop.org/software/vaapi/releases/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_URL="http://www.freedesktop.org/software/vaapi/testing/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libva libdrm"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"

View File

@ -1,73 +0,0 @@
From 545888beaa727d588c78422161a43355898cc908 Mon Sep 17 00:00:00 2001
From: "Xiang, Haihao" <haihao.xiang@intel.com>
Date: Mon, 23 Mar 2015 09:41:52 +0800
Subject: [PATCH] VPP: Make sure the store buffer is allocated
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
---
src/i965_post_processing.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 2c01e43..f5bf89c 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -1294,25 +1294,32 @@ pp_dndi_context_ensure_surfaces_storage(VADriverContextP ctx,
VASurfaceID new_surface;
unsigned int width, height;
- if (dndi_ctx->frame_store[i].obj_surface)
+ if (dndi_ctx->frame_store[i].obj_surface &&
+ dndi_ctx->frame_store[i].obj_surface->bo)
continue; // user allocated surface, not VPP internal
- if (i <= DNDI_FRAME_IN_STMM) {
- width = src_surface->orig_width;
- height = src_surface->orig_height;
- }
- else {
- width = dst_surface->orig_width;
- height = dst_surface->orig_height;
- }
+ if (dndi_ctx->frame_store[i].obj_surface) {
+ obj_surface = dndi_ctx->frame_store[i].obj_surface;
+ dndi_ctx->frame_store[i].is_scratch_surface = 0;
+ } else {
+ if (i <= DNDI_FRAME_IN_STMM) {
+ width = src_surface->orig_width;
+ height = src_surface->orig_height;
+ }
+ else {
+ width = dst_surface->orig_width;
+ height = dst_surface->orig_height;
+ }
- status = i965_CreateSurfaces(ctx, width, height, VA_RT_FORMAT_YUV420,
- 1, &new_surface);
- if (status != VA_STATUS_SUCCESS)
- return status;
+ status = i965_CreateSurfaces(ctx, width, height, VA_RT_FORMAT_YUV420,
+ 1, &new_surface);
+ if (status != VA_STATUS_SUCCESS)
+ return status;
- obj_surface = SURFACE(new_surface);
- assert(obj_surface != NULL);
+ obj_surface = SURFACE(new_surface);
+ assert(obj_surface != NULL);
+ dndi_ctx->frame_store[i].is_scratch_surface = 1;
+ }
if (i <= DNDI_FRAME_IN_PREVIOUS) {
status = i965_check_alloc_surface_bo(ctx, obj_surface,
@@ -1330,7 +1337,6 @@ pp_dndi_context_ensure_surfaces_storage(VADriverContextP ctx,
return status;
dndi_ctx->frame_store[i].obj_surface = obj_surface;
- dndi_ctx->frame_store[i].is_scratch_surface = 1;
}
return VA_STATUS_SUCCESS;
}
--
1.7.9.5

View File

@ -1,39 +0,0 @@
From: Andy Furniss <adf.lists at gmail.com>
Signed-off-by: Andy Furniss <adf.lists at gmail.com>
---
src/i965_post_processing.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index fefc5d7..edee114 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -3423,11 +3423,7 @@ pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_contex
obj_surface->orig_width, obj_surface->orig_height, obj_surface->width,
I965_SURFACEFORMAT_R8_UNORM, 20, 1);
- /* If we are in "First Frame" mode, i.e. past frames are not
- available for motion measure, then don't use the TFF flag */
- dndi_top_first = !(deint_params->flags & (dndi_ctx->is_first_frame ?
- VA_DEINTERLACING_BOTTOM_FIELD :
- VA_DEINTERLACING_BOTTOM_FIELD_FIRST));
+ dndi_top_first = !(deint_params->flags & VA_DEINTERLACING_BOTTOM_FIELD);
/* sampler dndi */
dri_bo_map(pp_context->sampler_state_table.bo, True);
@@ -3833,11 +3829,7 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c
obj_surface->orig_width, obj_surface->orig_height, obj_surface->width,
I965_SURFACEFORMAT_R8_UNORM, 33, 1);
- /* If we are in "First Frame" mode, i.e. past frames are not
- available for motion measure, then don't use the TFF flag */
- dndi_top_first = !(deint_params->flags & (dndi_ctx->is_first_frame ?
- VA_DEINTERLACING_BOTTOM_FIELD :
- VA_DEINTERLACING_BOTTOM_FIELD_FIRST));
+ dndi_top_first = !(deint_params->flags & VA_DEINTERLACING_BOTTOM_FIELD);
/* sampler dndi */
dri_bo_map(pp_context->sampler_state_table.bo, True);
--
1.7.9.5

View File

@ -17,12 +17,12 @@
################################################################################
PKG_NAME="libva"
PKG_VERSION="1.5.1"
PKG_VERSION="1.6.0.pre1"
PKG_REV="1"
PKG_ARCH="x86_64"
PKG_LICENSE="GPL"
PKG_SITE="http://freedesktop.org/wiki/Software/vaapi"
PKG_URL="http://cgit.freedesktop.org/vaapi/libva/snapshot/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_URL="http://www.freedesktop.org/software/vaapi/testing/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libX11 libXext libXfixes libdrm mesa glu"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="wireless-regdb"
PKG_VERSION="2015.04.06"
PKG_VERSION="2015.05.15"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="fuse"
PKG_VERSION="2.9.3"
PKG_VERSION="2.9.4"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -0,0 +1,19 @@
diff -Nru a/utils/keytable/rc_keymaps/rc6_mce b/utils/keytable/rc_keymaps/rc6_mce
--- a/utils/keytable/rc_keymaps/rc6_mce 2015-02-17 12:25:15.452561904 +0200
+++ b/utils/keytable/rc_keymaps/rc6_mce 2015-05-27 13:22:28.089766130 +0300
@@ -262,3 +262,15 @@
0x80d826 KEY_INFO
0x80d86f KEY_EPG
0x80d86e KEY_ZOOM
+
+#CuBox-i and HummingBoard remote control
+0x1f020b0 KEY_MEDIA
+0x1f02078 KEY_UP
+0x1f02044 KEY_ENTER
+0x1f020f8 KEY_DOWN
+0x1f02004 KEY_LEFT
+0x1f02084 KEY_RIGHT
+0x1f020c4 KEY_BACKSPACE
+0x1f02068 KEY_PLAYPAUSE
+0x1f02064 KEY_EPG
+

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="bcm2835-bootloader"
PKG_VERSION="70b0598"
PKG_VERSION="4d961a6"
PKG_REV="1"
PKG_ARCH="arm"
PKG_LICENSE="nonfree"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="libinput"
PKG_VERSION="0.15.0"
PKG_VERSION="0.17.0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="libmicrohttpd"
PKG_VERSION="0.9.41"
PKG_VERSION="0.9.42"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="LGPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="xf86-input-libinput"
PKG_VERSION="0.10.0"
PKG_VERSION="0.11.0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,12 +17,13 @@
################################################################################
PKG_NAME="xf86-video-intel"
PKG_VERSION="2.99.910"
PKG_VERSION="7d30cce"
PKG_REV="1"
PKG_ARCH="x86_64"
PKG_LICENSE="OSS"
PKG_SITE="http://intellinuxgraphics.org/"
PKG_URL="http://xorg.freedesktop.org/archive/individual/driver/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain libXcomposite util-macros fontsproto systemd xorg-server"
PKG_PRIORITY="optional"
PKG_SECTION="x11/driver"
@ -40,19 +41,17 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-backlight \
--enable-dri \
--disable-dri1 \
--enable-dri2 \
--enable-dri3 \
--disable-dri3 \
--enable-kms --enable-kms-only \
--disable-ums --disable-ums-only \
--enable-sna \
--enable-uxa \
--disable-xvmc \
--disable-glamor \
--disable-xaa \
--disable-dga \
--disable-tear-free \
--disable-rendernode \
--disable-create2 \
--disable-rotation \
--disable-async-swap \
--with-xorg-module-dir=$XORG_PATH_MODULES"

View File

@ -1,84 +0,0 @@
From 369ceec0e4910ba2c37736a59c55c0d6c26433bf Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue, 24 Feb 2015 15:25:40 +0000
Subject: uxa: udev integration depends on fstat and sys/stat.h
src/uxa/intel_driver.c: In function 'I830HandleUEvents':
src/uxa/intel_driver.c:738:14: error: storage size of 's' isn't known
src/uxa/intel_driver.c:746:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index c554124..6e64b8c 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -728,6 +728,8 @@ intel_flush_callback(CallbackListPtr *list,
}
#if HAVE_UDEV
+#include <sys/stat.h>
+
static void
I830HandleUEvents(int fd, void *closure)
{
--
cgit v0.10.2
From 12af8a575d1518d40416f83195049157c3a062a5 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue, 24 Feb 2015 15:25:40 +0000
Subject: sna: udev integration depends on fstat and sys/stat.h
src/sna/sna_driver.c: In function 'sna_handle_uevents':
src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
Also take the opportunity to include udev support in the configure
summary.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/configure.ac b/configure.ac
index 7476e2b..de3a4b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,11 +197,15 @@ AC_ARG_ENABLE(udev,
if test "x$UDEV" != "xno"; then
PKG_CHECK_MODULES(UDEV, [libudev], [udev="yes"], [udev="no"])
+ AC_CHECK_HEADERS([sys/stat.h], [], [udev="no"])
if test "x$UDEV" = "xyes" -a "x$udev" != "xyes"; then
AC_MSG_ERROR([udev support requested but not found (libudev)])
fi
if test "x$udev" = "xyes"; then
AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
+ udev_msg=" yes"
+ else
+ udev_msg=" no"
fi
fi
@@ -911,6 +915,7 @@ echo " Support for Kernel Mode Setting? $KMS"
echo " Support for legacy User Mode Setting (for i810)? $UMS"
echo " Support for Direct Rendering Infrastructure:$dri_msg"
echo " Support for Xv motion compensation (XvMC and libXvMC):$xvmc_msg"
+echo " Support for display hotplug notifications (udev):$udev_msg"
echo " Build additional tools and utilities?$tools_msg"
if test -n "$xp_msg"; then
echo " Experimental support:$xp_msg"
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 8c0d0b5..bc20ef0 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -740,6 +740,8 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL)
}
#if HAVE_UDEV
+#include <sys/stat.h>
+
static void
sna_handle_uevents(int fd, void *closure)
{
--
cgit v0.10.2

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="xorg-server"
PKG_VERSION="1.16.4"
PKG_VERSION="1.17.1"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
@ -59,7 +59,6 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-debug \
--disable-xselinux \
--enable-aiglx \
--enable-glx-tls \
--enable-registry \
$XORG_COMPOSITE \
--enable-mitshm \
--disable-xres \
@ -113,6 +112,7 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-debug \
--disable-kdrive-mouse \
--disable-kdrive-evdev \
--disable-libunwind \
--enable-xshmfence \
--disable-install-setuid \
--enable-unix-transport \
--disable-tcp-transport \

File diff suppressed because one or more lines are too long

View File

@ -1024,7 +1024,7 @@ CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="bnx2/bnx2-mips-06-6.2.1.fw bnx2/bnx2-mips-09-6.2.1a.fw bnx2/bnx2-rv2p-06-6.0.15.fw bnx2/bnx2-rv2p-09-6.0.17.fw bnx2/bnx2-rv2p-09ax-6.0.17.fw tigon/tg3.bin tigon/tg3_tso5.bin tigon/tg3_tso.bin rtl_nic/rtl8105e-1.fw rtl_nic/rtl8106e-1.fw rtl_nic/rtl8106e-2.fw rtl_nic/rtl8168d-1.fw rtl_nic/rtl8168d-2.fw rtl_nic/rtl8168e-1.fw rtl_nic/rtl8168e-2.fw rtl_nic/rtl8168e-3.fw rtl_nic/rtl8168f-1.fw rtl_nic/rtl8168f-2.fw rtl_nic/rtl8168g-1.fw rtl_nic/rtl8168g-2.fw rtl_nic/rtl8168g-3.fw rtl_nic/rtl8402-1.fw rtl_nic/rtl8411-1.fw rtl_nic/rtl8411-2.fw"
CONFIG_EXTRA_FIRMWARE="bnx2/bnx2-mips-06-6.2.1.fw bnx2/bnx2-mips-09-6.2.1a.fw bnx2/bnx2-rv2p-06-6.0.15.fw bnx2/bnx2-rv2p-09-6.0.17.fw bnx2/bnx2-rv2p-09ax-6.0.17.fw tigon/tg3.bin tigon/tg3_tso5.bin tigon/tg3_tso.bin rtl_nic/rtl8105e-1.fw rtl_nic/rtl8106e-1.fw rtl_nic/rtl8106e-2.fw rtl_nic/rtl8107e-1.fw rtl_nic/rtl8107e-2.fw rtl_nic/rtl8168d-1.fw rtl_nic/rtl8168d-2.fw rtl_nic/rtl8168e-1.fw rtl_nic/rtl8168e-2.fw rtl_nic/rtl8168e-3.fw rtl_nic/rtl8168f-1.fw rtl_nic/rtl8168f-2.fw rtl_nic/rtl8168g-1.fw rtl_nic/rtl8168g-2.fw rtl_nic/rtl8168g-3.fw rtl_nic/rtl8168h-1.fw rtl_nic/rtl8168h-2.fw rtl_nic/rtl8402-1.fw rtl_nic/rtl8411-1.fw rtl_nic/rtl8411-2.fw"
CONFIG_EXTRA_FIRMWARE_DIR="firmware"
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
CONFIG_WANT_DEV_COREDUMP=y

View File

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.0.4 Kernel Configuration
# Linux/arm 4.0.5 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@ -313,7 +313,6 @@ CONFIG_ARCH_BCM2708=y
CONFIG_MACH_BCM2708=y
CONFIG_BCM2708_DT=y
CONFIG_BCM2708_GPIO=y
CONFIG_BCM2708_VCMEM=y
# CONFIG_BCM2708_NOL2CACHE is not set
CONFIG_BCM2708_SPIDEV=y
@ -1372,6 +1371,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HW_RANDOM_BCM2708=m
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
@ -1379,6 +1379,7 @@ CONFIG_HW_RANDOM_BCM2708=m
CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BCM_VC_CMA=y
# CONFIG_BCM_VC_SM is not set
CONFIG_BCM2708_VCMEM=y
# CONFIG_XILLYBUS is not set
#
@ -1447,8 +1448,8 @@ CONFIG_SPI_MASTER=y
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_BCM2835 is not set
CONFIG_SPI_BCM2708=y
CONFIG_SPI_BCM2835=m
CONFIG_SPI_BCM2708=m
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_GPIO is not set
@ -1739,7 +1740,7 @@ CONFIG_THERMAL_BCM2835=y
# Texas Instruments thermal drivers
#
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
@ -1753,6 +1754,7 @@ CONFIG_WATCHDOG=y
# CONFIG_DW_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
CONFIG_BCM2708_WDT=m
CONFIG_BCM2835_WDT=m
# CONFIG_MEN_A21_WDT is not set
#
@ -3012,7 +3014,10 @@ CONFIG_COMMON_CLK=y
# CONFIG_SH_TIMER_TMU is not set
# CONFIG_EM_TIMER_STI is not set
# CONFIG_CLKSRC_VERSATILE is not set
# CONFIG_MAILBOX is not set
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
# CONFIG_PL320_MBOX is not set
# CONFIG_ALTERA_MBOX is not set
# CONFIG_IOMMU_SUPPORT is not set
#
@ -3027,6 +3032,7 @@ CONFIG_COMMON_CLK=y
#
# SOC (System On Chip) specific Drivers
#
CONFIG_BCM2708_POWER=y
# CONFIG_SOC_TI is not set
# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=m

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.0.4 Kernel Configuration
# Linux/arm 4.0.5 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@ -319,7 +319,6 @@ CONFIG_MMU=y
# CONFIG_ARCH_OMAP1 is not set
CONFIG_ARCH_BCM2709=y
CONFIG_BCM2708_GPIO=y
CONFIG_BCM2708_VCMEM=y
CONFIG_BCM2708_NOL2CACHE=y
CONFIG_BCM2708_SPIDEV=y
@ -1424,6 +1423,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HW_RANDOM_BCM2708=m
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
@ -1431,6 +1431,7 @@ CONFIG_HW_RANDOM_BCM2708=m
CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BCM_VC_CMA=y
# CONFIG_BCM_VC_SM is not set
CONFIG_BCM2708_VCMEM=y
# CONFIG_XILLYBUS is not set
#
@ -1499,8 +1500,8 @@ CONFIG_SPI_MASTER=y
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_BCM2835 is not set
CONFIG_SPI_BCM2708=y
CONFIG_SPI_BCM2835=m
CONFIG_SPI_BCM2708=m
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_GPIO is not set
@ -1791,7 +1792,7 @@ CONFIG_THERMAL_BCM2835=y
# Texas Instruments thermal drivers
#
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
@ -1805,6 +1806,7 @@ CONFIG_WATCHDOG=y
# CONFIG_DW_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
CONFIG_BCM2708_WDT=m
CONFIG_BCM2835_WDT=m
# CONFIG_MEN_A21_WDT is not set
#
@ -3067,7 +3069,10 @@ CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
# CONFIG_SH_TIMER_TMU is not set
# CONFIG_EM_TIMER_STI is not set
# CONFIG_CLKSRC_VERSATILE is not set
# CONFIG_MAILBOX is not set
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
# CONFIG_PL320_MBOX is not set
# CONFIG_ALTERA_MBOX is not set
# CONFIG_IOMMU_SUPPORT is not set
#
@ -3082,6 +3087,7 @@ CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
#
# SOC (System On Chip) specific Drivers
#
CONFIG_BCM2708_POWER=y
# CONFIG_SOC_TI is not set
# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=m

File diff suppressed because it is too large Load Diff

View File

@ -1184,7 +1184,7 @@ CONFIG_FB_OSD1_DEFAULT_WIDTH=1280
CONFIG_FB_OSD1_DEFAULT_HEIGHT=720
CONFIG_FB_OSD1_DEFAULT_WIDTH_VIRTUAL=1280
CONFIG_FB_OSD1_DEFAULT_HEIGHT_VIRTUAL=1440
CONFIG_FB_AMLOGIC_UMP=y
# CONFIG_FB_AMLOGIC_UMP is not set
#
# Amlogic osd_ext module

View File

@ -0,0 +1,15 @@
#
# Configuration for iMX6 sgtl5000 analog output - /usr/share/alsa/cards/imx-sgtl5000.conf
#
<confdir:pcm/front.conf>
imx-sgtl5000.pcm.front.0 {
@args [ CARD ]
@args.CARD {
type string
}
type hw
card $CARD
device 0
}

View File

@ -1,14 +1,14 @@
From be220380dbd0a899ff49434d1b0c68c9b07830b6 Mon Sep 17 00:00:00 2001
From 206e92e6a26ca57aff2ceba09275f5c1441a155c Mon Sep 17 00:00:00 2001
From: vpeter4 <peter.vicman@gmail.com>
Date: Thu, 11 Dec 2014 18:37:24 +0100
Date: Wed, 3 Jun 2015 17:58:54 +0200
Subject: [PATCH] udoo quad device tree
---
arch/arm/boot/dts/imx6q-udoo.dts | 350 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 343 insertions(+), 7 deletions(-)
arch/arm/boot/dts/imx6q-udoo.dts | 348 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 342 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/imx6q-udoo.dts b/arch/arm/boot/dts/imx6q-udoo.dts
index 1b8cce1..83b9a62 100644
index 7cc0267..d4f6acb 100644
--- a/arch/arm/boot/dts/imx6q-udoo.dts
+++ b/arch/arm/boot/dts/imx6q-udoo.dts
@@ -2,6 +2,10 @@
@ -22,179 +22,171 @@ index 1b8cce1..83b9a62 100644
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -16,14 +20,166 @@
model = "Udoo i.MX6 Quad Board";
@@ -17,12 +21,213 @@
compatible = "udoo,imx6q-udoo", "fsl,imx6q";
- chosen {
chosen {
- stdout-path = &uart2;
+ aliases {
+ mxcfb0 = &mxcfb1;
+ mxcfb1 = &mxcfb2;
+ mxcfb2 = &mxcfb3;
+ mxcfb3 = &mxcfb4;
+ stdout-path = &uart1;
};
+ chosen {
+ stdout-path = &uart1;
+ };
+
+ aliases {
+ mxcfb0 = &mxcfb1;
+ mxcfb1 = &mxcfb2;
+ mxcfb2 = &mxcfb3;
+ mxcfb3 = &mxcfb4;
+ };
+
memory {
reg = <0x10000000 0x40000000>;
};
+ regulators {
+ compatible = "simple-bus";
+
+ reg_2p5v: 2p5v {
+ compatible = "regulator-fixed";
+ regulator-name = "2P5V";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-always-on;
+ };
+
+ reg_3p3v: 3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "3P3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ aux_5v: aux5v {
+ compatible = "regulator-fixed";
+ regulator-name = "AUX_5V";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio6 10 1>;
+ regulator-boot-on;
+ enable-active-high;
+ };
+
+ reg_sensor: sensor_supply {
+ compatible = "regulator-fixed";
+ regulator-name = "sensor-SUPPLY";
+ enable-active-high;
+ };
+
+ reg_usb_otg_vbus: usb_otg_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_otg_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ };
+
+ reg_usb_h1_vbus: usb_h1_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_h1_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ startup-delay-us = <2>; /* USB2415 requires a POR of 1 us minimum */
+ gpio = <&gpio7 12 0>;
+ };
+ };
+ regulators {
+ compatible = "simple-bus";
+
+ mxcfb1: fb@0 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "okay";
+ };
+
+ mxcfb2: fb@1 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+
+ mxcfb3: fb@2 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+
+ mxcfb4: fb@3 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+ reg_2p5v: 2p5v {
+ compatible = "regulator-fixed";
+ regulator-name = "2P5V";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-always-on;
+ };
+
+ codec: vt1613 {
+ compatible = "wlf,vt1613";
+ amic-mono;
+ };
+ reg_3p3v: 3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "3P3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ sound {
+ compatible = "fsl,imx6q-udoo-vt1613",
+ "fsl,imx-audio-vt1613";
+ model = "vt1613-audio";
+ ssi-controller = <&ssi1>;
+ audio-codec = <&codec>;
+ audio-routing =
+ "Headphone Jack", "HPOUTL",
+ "Headphone Jack", "HPOUTR",
+ "Ext Spk", "SPKOUTL",
+ "Ext Spk", "SPKOUTR",
+ "MICBIAS", "AMIC",
+ "IN3R", "MICBIAS",
+ "DMIC", "MICBIAS",
+ "DMICDAT", "DMIC";
+ mux-int-port = <1>;
+ mux-ext-port = <6>;
+ };
+// hp-det-gpios = <&gpio7 8 1>;
+// mic-det-gpios = <&gpio1 9 1>;
+ aux_5v: aux5v {
+ compatible = "regulator-fixed";
+ regulator-name = "AUX_5V";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio6 10 1>;
+ regulator-boot-on;
+ enable-active-high;
+ };
+
+ sound-hdmi {
+ compatible = "fsl,imx6q-audio-hdmi",
+ "fsl,imx-audio-hdmi";
+ model = "imx-audio-hdmi";
+ hdmi-controller = <&hdmi_audio>;
+ };
+ reg_sensor: sensor_supply {
+ compatible = "regulator-fixed";
+ regulator-name = "sensor-SUPPLY";
+ enable-active-high;
+ };
+
+ sound-spdif {
+ compatible = "fsl,imx-audio-spdif",
+ "fsl,imx-sabreauto-spdif";
+ model = "imx-spdif";
+ spdif-controller = <&spdif>;
+ spdif-in;
+ status = "disabled";
+ };
+
+ v4l2_out {
+ compatible = "fsl,mxc_v4l2_output";
+ status = "okay";
+ };
+ reg_usb_otg_vbus: usb_otg_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_otg_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ };
+
+ reg_usb_h1_vbus: usb_h1_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_h1_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ startup-delay-us = <2>; /* USB2415 requires a POR of 1 us minimum */
+ gpio = <&gpio7 12 0>;
+ };
+ };
+
+ mxcfb1: fb@0 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "okay";
+ };
+
+ mxcfb2: fb@1 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+
+ mxcfb3: fb@2 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+
+ mxcfb4: fb@3 {
+ compatible = "fsl,mxc_sdc_fb";
+ disp_dev = "hdmi";
+ interface_pix_fmt = "RGB24";
+ mode_str ="1920x1080M@60";
+ default_bpp = <24>;
+ int_clk = <0>;
+ late_init = <0>;
+ status = "disabled";
+ };
+
+ codec: vt1613 {
+ compatible = "wlf,vt1613";
+ amic-mono;
+ };
+
+ sound {
+ compatible = "fsl,imx6q-udoo-vt1613",
+ "fsl,imx-audio-vt1613";
+ model = "vt1613-audio";
+ ssi-controller = <&ssi1>;
+ audio-codec = <&codec>;
+ audio-routing =
+ "Headphone Jack", "HPOUTL",
+ "Headphone Jack", "HPOUTR",
+ "Ext Spk", "SPKOUTL",
+ "Ext Spk", "SPKOUTR",
+ "MICBIAS", "AMIC",
+ "IN3R", "MICBIAS",
+ "DMIC", "MICBIAS",
+ "DMICDAT", "DMIC";
+ mux-int-port = <1>;
+ mux-ext-port = <6>;
+ };
+// hp-det-gpios = <&gpio7 8 1>;
+// mic-det-gpios = <&gpio1 9 1>;
+
+ sound-hdmi {
+ compatible = "fsl,imx6q-audio-hdmi",
+ "fsl,imx-audio-hdmi";
+ model = "imx-audio-hdmi";
+ hdmi-controller = <&hdmi_audio>;
+ };
+
+ sound-spdif {
+ compatible = "fsl,imx-audio-spdif",
+ "fsl,imx-sabreauto-spdif";
+ model = "imx-spdif";
+ spdif-controller = <&spdif>;
+ spdif-in;
+ status = "disabled";
+ };
+
+ v4l2_out {
+ compatible = "fsl,mxc_v4l2_output";
+ status = "okay";
+ };
+};
+
poweroff {
compatible = "udoo,poweroff";
sam3x_rst_gpio = <&gpio1 0 0>;
@@ -31,6 +187,55 @@
};
};
+&hdmi_audio {
+ status = "okay";
+};
@ -223,7 +215,7 @@ index 1b8cce1..83b9a62 100644
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2_2>;
+ status = "okay";
+
+/*
+ egalax_ts@04 {
+ compatible = "eeti,egalax_ts";
+ reg = <0x04>;
@ -231,7 +223,7 @@ index 1b8cce1..83b9a62 100644
+ interrupts = <28 2>;
+ wakeup-gpios = <&gpio2 28 0>;
+ };
+
+*/
+ hdmi: edid@50 {
+ compatible = "fsl,imx6-hdmi-i2c";
+ reg = <0x50>;
@ -242,12 +234,10 @@ index 1b8cce1..83b9a62 100644
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c3_5>;
+ status = "okay";
+};
+
};
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet>;
@@ -39,9 +244,68 @@
@@ -33,9 +238,68 @@
};
&iomuxc {
@ -257,7 +247,7 @@ index 1b8cce1..83b9a62 100644
imx6q-udoo {
- pinctrl_enet: enetgrp {
+ pinctrl_hog: hoggrp {
fsl,pins = <
+ fsl,pins = <
+ MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x80000000 /* 5v enable */
+ MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x80000000 /* Vtt suspend */
+ MX6QDL_PAD_SD2_DAT0__GPIO1_IO15 0x80000000 /* touch reset */
@ -292,7 +282,7 @@ index 1b8cce1..83b9a62 100644
+ };
+
+ pinctrl_i2c1_2: i2c1grp-2 {
+ fsl,pins = <
fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
+ MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
+ >;
@ -317,7 +307,7 @@ index 1b8cce1..83b9a62 100644
MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
@@ -57,10 +321,10 @@
@@ -51,10 +315,10 @@
MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
@ -330,7 +320,7 @@ index 1b8cce1..83b9a62 100644
pinctrl_uart2: uart2grp {
fsl,pins = <
MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
@@ -68,19 +332,51 @@
@@ -62,19 +326,51 @@
>;
};
@ -384,7 +374,7 @@ index 1b8cce1..83b9a62 100644
&sata {
status = "okay";
};
@@ -91,9 +387,49 @@
@@ -85,9 +381,49 @@
status = "okay";
};
@ -436,4 +426,3 @@ index 1b8cce1..83b9a62 100644
};
--
1.8.1.2

View File

@ -1,254 +0,0 @@
From c95f6c30e3230b02e90b98ca6ec8e8c2784141eb Mon Sep 17 00:00:00 2001
From: vpeter4 <peter.vicman@gmail.com>
Date: Thu, 21 May 2015 20:42:22 +0200
Subject: [PATCH] Add poweroff driver.
Use original power_off function from rtc-snvs if set.
Arduino operation is controled by device tree parameter.
From 1bc304cd507fe9eb5673223f0d76ec0aa4ff55f3 Mon Sep 17 00:00:00 2001
From: mxt512 <mtx512@yahoo.co.uk>
Date: Thu, 13 Feb 2014 20:13:27 +0000
Subject: [PATCH] Add poweroff driver.
Existing pm_power_off function was in rtc-snvs. Given we need to reset the SAM3X and turn off
the 5v supply on power down, lets implement a power-off driver to do this for now.
TODO: Not the cleanest solution but it works, should revisit.
Overwriting power_off function with udoo_power_off in case uddo is used.
---
arch/arm/boot/dts/imx6q-udoo.dts | 12 ++++
arch/arm/mach-imx/mach-imx6q.c | 44 ++++++++++++++
drivers/power/reset/Kconfig | 8 +++
drivers/power/reset/Makefile | 1 +
drivers/power/reset/udoo-poweroff.c | 113 ++++++++++++++++++++++++++++++++++++
5 files changed, 178 insertions(+)
create mode 100644 drivers/power/reset/udoo-poweroff.c
diff --git a/arch/arm/boot/dts/imx6q-udoo.dts b/arch/arm/boot/dts/imx6q-udoo.dts
index 7cc0267..6c9d46f 100644
--- a/arch/arm/boot/dts/imx6q-udoo.dts
+++ b/arch/arm/boot/dts/imx6q-udoo.dts
@@ -23,6 +23,13 @@
memory {
reg = <0x10000000 0x40000000>;
};
+
+ poweroff {
+ compatible = "udoo,poweroff";
+ sam3x_rst_gpio = <&gpio1 0 GPIO_ACTIVE_LOW>;
+ pwr_5v_gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;
+ arduino_mode = <0>;
+ };
};
&fec {
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index a466891..ed49659 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -280,6 +280,46 @@ static inline void imx6q_enet_init(void)
imx6q_1588_init();
}
+#ifdef CONFIG_POWER_RESET_UDOO
+#define ARDUINO_MODE_STOPPED 1 /* does arduino starts at boot */
+#define ARDUINO_MODE_LEAVE_POWER 2 /* leave 5V power on after shutdown (to keep arduino reset) */
+
+static inline void imx6q_udoo_gpio_init(void)
+{
+ struct device_node *pwr_off_np;
+ int sam3x_rst_gpio = -EINVAL;
+ u32 arduino_mode = -EINVAL;
+ int ret;
+
+ pwr_off_np = of_find_compatible_node(NULL, NULL, "udoo,poweroff");
+ if (pwr_off_np == NULL)
+ return;
+
+ pr_emerg("%s: setup sam3x reset gpio\n", __func__);
+
+ ret = of_property_read_u32(pwr_off_np, "arduino_mode", &arduino_mode);
+ if (ret != 0) {
+ pr_err("%s: arduino mode not found in dtb\n", __func__);
+ arduino_mode = 0;
+ }
+
+ pr_emerg("%s: arduino_mode set to %d\n", __func__, arduino_mode);
+ sam3x_rst_gpio = of_get_named_gpio(pwr_off_np, "sam3x_rst_gpio", 0);
+ of_node_put(pwr_off_np);
+
+ if (gpio_is_valid(sam3x_rst_gpio)) {
+ if (arduino_mode & ARDUINO_MODE_STOPPED) {
+ pr_emerg("%s: arduino stopped\n", __func__);
+ ret = gpio_request_one(sam3x_rst_gpio, GPIOF_OUT_INIT_LOW, "sam3x_rst_gpio");
+ } else {
+ ret = gpio_request_one(sam3x_rst_gpio, GPIOF_OUT_INIT_HIGH, "sam3x_rst_gpio");
+ }
+
+ ret = gpio_export(sam3x_rst_gpio, false);
+ }
+}
+#endif
+
static void __init imx6q_init_machine(void)
{
struct device *parent;
@@ -299,6 +339,10 @@ static void __init imx6q_init_machine(void)
imx_anatop_init();
cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
imx6q_csi_mux_init();
+
+#ifdef CONFIG_POWER_RESET_UDOO
+ imx6q_udoo_gpio_init();
+#endif
}
#define OCOTP_CFG3 0x440
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 6d452a7..1a0620f 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -57,3 +57,11 @@ config POWER_RESET_XGENE
depends on POWER_RESET
help
Reboot support for the APM SoC X-Gene Eval boards.
+
+config POWER_RESET_UDOO
+ bool "UDOO power-off driver"
+ depends on POWER_RESET
+ help
+ This driver supports powering down the UDOO.
+ Say Y if you have a UDOO.
+
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
index a5b4a77..9b8e1b0 100644
--- a/drivers/power/reset/Makefile
+++ b/drivers/power/reset/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
obj-$(CONFIG_POWER_RESET_VEXPRESS) += vexpress-poweroff.o
obj-$(CONFIG_POWER_RESET_XGENE) += xgene-reboot.o
+obj-$(CONFIG_POWER_RESET_UDOO) += udoo-poweroff.o
diff --git a/drivers/power/reset/udoo-poweroff.c b/drivers/power/reset/udoo-poweroff.c
new file mode 100644
index 0000000..2a2aecf
--- /dev/null
+++ b/drivers/power/reset/udoo-poweroff.c
@@ -0,0 +1,113 @@
+/*
+ * UDOO board power off
+ *
+ *
+ * Copyright (C) 2014 Jasbir Matharu
+ * Copyright (C) 2015 vpeter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/gpio.h>
+#include <linux/delay.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/of_gpio.h>
+
+#define ARDUINO_MODE_STOPPED 1 /* does arduino starts at boot */
+#define ARDUINO_MODE_LEAVE_POWER 2 /* leave 5V power on after shutdown (to keep arduino reset) */
+
+static void (*pm_power_off_orig)(void) = NULL;
+static int sam3x_rst_gpio = -EINVAL;
+static int pwr_5v_gpio = -EINVAL;
+static u32 arduino_mode = -EINVAL;
+
+static void udoo_power_off(void) {
+ int ret;
+
+ pr_emerg("%s: powering off\n", __func__);
+ if (pm_power_off_orig != NULL)
+ pm_power_off_orig();
+
+ if (gpio_is_valid(sam3x_rst_gpio)) {
+ pr_emerg("%s: sam3x reset\n", __func__);
+ ret = gpio_direction_output(sam3x_rst_gpio, 0);
+ if (ret)
+ pr_emerg("%s: sam3x reset unsuccessful\n", __func__);
+
+ msleep(50);
+ }
+
+ if (gpio_is_valid(pwr_5v_gpio) && (arduino_mode & ARDUINO_MODE_LEAVE_POWER) == 0) {
+ pr_emerg("%s: 5V power down\n", __func__);
+ ret = gpio_request_one(pwr_5v_gpio, GPIOF_OUT_INIT_HIGH, "pwr_5v_gpio");
+ if (ret)
+ pr_emerg("%s: 5V power down unsuccessful\n", __func__);
+ } else
+ pr_emerg("%s: 5V power still on, sam3x reset\n", __func__);
+}
+
+static int udoo_power_off_probe(struct platform_device *pdev)
+{
+ struct device_node *pwr_off_np;
+ int ret;
+
+ pr_emerg("%s: power-off probe\n", __func__);
+
+ pwr_off_np = of_find_compatible_node(NULL, NULL, "udoo,poweroff");
+ if (pwr_off_np) {
+ ret = of_property_read_u32(pwr_off_np, "arduino_mode", &arduino_mode);
+ if (ret != 0) {
+ pr_emerg("%s: arduino mode not found in dtb\n", __func__);
+ arduino_mode = 0;
+ }
+
+ sam3x_rst_gpio = of_get_named_gpio(pwr_off_np, "sam3x_rst_gpio", 0);
+ pwr_5v_gpio = of_get_named_gpio(pwr_off_np, "pwr_5v_gpio", 0);
+ of_node_put(pwr_off_np);
+
+ pm_power_off_orig = pm_power_off;
+ pm_power_off = udoo_power_off;
+ return 0;
+ }
+
+ /* If a pm_power_off function has already been added, leave it alone */
+ if (pm_power_off != NULL) {
+ pr_emerg("%s: pm_power_off function already registered\n", __func__);
+ return -EBUSY;
+ }
+
+ return -ENODEV;
+}
+
+static int udoo_power_off_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static const struct of_device_id power_off_dt_ids[] = {
+ { .compatible = "udoo,poweroff", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, power_off_dt_ids);
+
+static struct platform_driver udoo_power_off_driver = {
+ .driver = {
+ .name = "udoo_power_off",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(power_off_dt_ids),
+ },
+ .probe = udoo_power_off_probe,
+ .remove = udoo_power_off_remove,
+};
+module_platform_driver(udoo_power_off_driver);
+
+MODULE_AUTHOR("Jasbir Matharu, vpeter");
+MODULE_DESCRIPTION("UDOO Power off driver v2");
+MODULE_LICENSE("GPL v2");
--
1.8.1.2

View File

@ -0,0 +1,640 @@
From 8a7ac9c15a3e6e25f8a3238c26a2584d84c6b38f Mon Sep 17 00:00:00 2001
From: vpeter4 <peter.vicman@gmail.com>
Date: Wed, 3 Jun 2015 18:15:31 +0200
Subject: [PATCH] update driver for st1232 touchscreen controller
Original driver is multitouch only and Kodi doesnt understand
this input events. Driver was modified to start as singletouch
and also supports touch button in this mode.
---
drivers/input/touchscreen/st1232.c | 554 ++++++++++++++++++++++---------------
1 file changed, 331 insertions(+), 223 deletions(-)
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 5c342b3..e1254a1 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -1,12 +1,13 @@
/*
- * ST1232 Touchscreen Controller Driver
+ * ST1232/ST1332 Touchscreen Controller Driver
*
* Copyright (C) 2010 Renesas Solutions Corp.
- * Tony SIM <chinyeow.sim.xt@renesas.com>
+ * Tony SIM <chinyeow.sim.xt@renesas.com>
+ * Copyright (C) 2015 Peter Vicman <peter.vicman@gmail.com>
*
* Using code from:
* - android.git.kernel.org: projects/kernel/common.git: synaptics_i2c_rmi.c
- * Copyright (C) 2007 Google, Inc.
+ * Copyright (C) 2007 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -30,282 +31,383 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/platform_data/st1232_pdata.h>
-
-#define ST1232_TS_NAME "st1232-ts"
-
-#define MIN_X 0x00
-#define MIN_Y 0x00
-#define MAX_X 0x31f /* (800 - 1) */
-#define MAX_Y 0x1df /* (480 - 1) */
-#define MAX_AREA 0xff
-#define MAX_FINGERS 2
+#include <linux/workqueue.h>
+
+#define ST1232_TS_NAME "st1232-ts"
+#define MIN_X 0
+#define MIN_Y 0
+#define MAX_X (800 - 1)
+#define MAX_Y (480 - 1)
+#define MAX_AREA 0xff
+#define MAX_FINGERS 2
+#define SAMPLE_DELAY 20 /* msecs */
+#define REVERSE_X(x) if (reverse_x == true) { x = MAX_X - (x); } else {}
+#define REVERSE_Y(y) if (reverse_y == true) { y = MAX_Y - (y); } else {}
struct st1232_ts_finger {
- u16 x;
- u16 y;
- u8 t;
- bool is_valid;
+ u16 x;
+ u16 y;
+ u8 t;
+ bool is_valid;
};
struct st1232_ts_data {
- struct i2c_client *client;
- struct input_dev *input_dev;
- struct st1232_ts_finger finger[MAX_FINGERS];
- struct dev_pm_qos_request low_latency_req;
- int reset_gpio;
+ struct i2c_client *client;
+ struct input_dev *input_dev;
+ struct st1232_ts_finger finger[MAX_FINGERS];
+ struct dev_pm_qos_request low_latency_req;
+ int reset_gpio;
+ struct delayed_work work;
};
+static bool multitouch = false;
+module_param(multitouch, bool, 0);
+MODULE_PARM_DESC(multitouch, " If multitouch is set to 1 ts acts as multitouch");
+
+static bool reverse_x = false;
+module_param(reverse_x, bool, 0600);
+MODULE_PARM_DESC(reverse_x, " If reverse_x is set to 1 x coordinates are reversed");
+
+static bool reverse_y = false;
+module_param(reverse_y, bool, 0600);
+MODULE_PARM_DESC(reverse_y, " If reverse_y is set to 1 y coordinates are reversed");
+
+static int offset_x = 0;
+module_param(offset_x, int, 0600);
+MODULE_PARM_DESC(offset_x, " Offset value for x axis");
+
+static int offset_y = 0;
+module_param(offset_y, int, 0600);
+MODULE_PARM_DESC(offset_y, " Offset value for y axis");
+
static int st1232_ts_read_data(struct st1232_ts_data *ts)
{
- struct st1232_ts_finger *finger = ts->finger;
- struct i2c_client *client = ts->client;
- struct i2c_msg msg[2];
- int error;
- u8 start_reg;
- u8 buf[10];
-
- /* read touchscreen data from ST1232 */
- msg[0].addr = client->addr;
- msg[0].flags = 0;
- msg[0].len = 1;
- msg[0].buf = &start_reg;
- start_reg = 0x10;
-
- msg[1].addr = ts->client->addr;
- msg[1].flags = I2C_M_RD;
- msg[1].len = sizeof(buf);
- msg[1].buf = buf;
-
- error = i2c_transfer(client->adapter, msg, 2);
- if (error < 0)
- return error;
-
- /* get "valid" bits */
- finger[0].is_valid = buf[2] >> 7;
- finger[1].is_valid = buf[5] >> 7;
-
- /* get xy coordinate */
- if (finger[0].is_valid) {
- finger[0].x = ((buf[2] & 0x0070) << 4) | buf[3];
- finger[0].y = ((buf[2] & 0x0007) << 8) | buf[4];
- finger[0].t = buf[8];
- }
-
- if (finger[1].is_valid) {
- finger[1].x = ((buf[5] & 0x0070) << 4) | buf[6];
- finger[1].y = ((buf[5] & 0x0007) << 8) | buf[7];
- finger[1].t = buf[9];
- }
-
- return 0;
+ struct st1232_ts_finger *finger = ts->finger;
+ struct i2c_client *client = ts->client;
+ struct i2c_msg msg[2];
+ int error;
+ u8 start_reg;
+ u8 buf[10];
+
+ /* read touchscreen data from ST1232 */
+ msg[0].addr = client->addr;
+ msg[0].flags = 0;
+ msg[0].len = 1;
+ msg[0].buf = &start_reg;
+ start_reg = 0x10;
+
+ msg[1].addr = ts->client->addr;
+ msg[1].flags = I2C_M_RD;
+ msg[1].len = sizeof(buf);
+ msg[1].buf = buf;
+
+ error = i2c_transfer(client->adapter, msg, 2);
+ if (error < 0)
+ return error;
+
+ memset(finger, 0x0, sizeof(struct st1232_ts_finger) * MAX_FINGERS);
+
+ /* get "valid" bits from fingers
+ and combine with "valid" bits from coordinates */
+ finger[0].is_valid = (buf[0] & 0x07); /* only 3 bits on st1332 */
+ finger[0].is_valid &= (buf[2] >> 7);
+ finger[1].is_valid = (buf[0] & 0x07);
+ finger[1].is_valid &= (buf[5] >> 7);
+
+ /* get xy coordinates and strength */
+ if (finger[0].is_valid) {
+ finger[0].x = ((buf[2] & 0x0070) << 4) | buf[3];
+ finger[0].y = ((buf[2] & 0x0007) << 8) | buf[4];
+ finger[0].t = buf[8];
+
+ REVERSE_X(finger[0].x)
+ REVERSE_Y(finger[0].y)
+
+ finger[0].x += offset_x;
+ finger[0].y += offset_y;
+ }
+
+ if (finger[1].is_valid) {
+ finger[1].x = ((buf[5] & 0x0070) << 4) | buf[6];
+ finger[1].y = ((buf[5] & 0x0007) << 8) | buf[7];
+ finger[1].t = buf[9];
+
+ REVERSE_X(finger[1].x)
+ REVERSE_Y(finger[1].y)
+ }
+
+ return 0;
+}
+
+static void st1232_ts_finger_released(struct work_struct *work)
+{
+ struct st1232_ts_data *ts = container_of(work, struct st1232_ts_data, work.work);
+ struct st1232_ts_finger *finger = ts->finger;
+ struct input_dev *input_dev = ts->input_dev;
+ int ret;
+
+ ret = st1232_ts_read_data(ts);
+ if (ret < 0)
+ goto end;
+
+ /* finger is a pointer to finger[0] */
+ if (finger->is_valid)
+ goto end; /* finger (still) touched */
+
+ /* finger released */
+ input_report_abs(input_dev, ABS_PRESSURE, 0);
+ input_report_key(input_dev, BTN_TOUCH, 0);
+ input_sync(input_dev);
+
+end:
+ return;
}
static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)
{
- struct st1232_ts_data *ts = dev_id;
- struct st1232_ts_finger *finger = ts->finger;
- struct input_dev *input_dev = ts->input_dev;
- int count = 0;
- int i, ret;
-
- ret = st1232_ts_read_data(ts);
- if (ret < 0)
- goto end;
-
- /* multi touch protocol */
- for (i = 0; i < MAX_FINGERS; i++) {
- if (!finger[i].is_valid)
- continue;
-
- input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, finger[i].t);
- input_report_abs(input_dev, ABS_MT_POSITION_X, finger[i].x);
- input_report_abs(input_dev, ABS_MT_POSITION_Y, finger[i].y);
- input_mt_sync(input_dev);
- count++;
- }
-
- /* SYN_MT_REPORT only if no contact */
- if (!count) {
- input_mt_sync(input_dev);
- if (ts->low_latency_req.dev) {
- dev_pm_qos_remove_request(&ts->low_latency_req);
- ts->low_latency_req.dev = NULL;
- }
- } else if (!ts->low_latency_req.dev) {
- /* First contact, request 100 us latency. */
- dev_pm_qos_add_ancestor_request(&ts->client->dev,
- &ts->low_latency_req, 100);
- }
-
- /* SYN_REPORT */
- input_sync(input_dev);
+ struct st1232_ts_data *ts = dev_id;
+ struct st1232_ts_finger *finger = ts->finger;
+ struct input_dev *input_dev = ts->input_dev;
+ int count = 0;
+ int i, ret;
+
+ if (multitouch == false) {
+ /*
+ * Cancel scheduled polling for release if we have new value
+ * available. Wait if the polling is already running.
+ */
+ cancel_delayed_work_sync(&ts->work);
+ }
+
+ ret = st1232_ts_read_data(ts);
+ if (ret < 0)
+ goto end;
+
+ if (multitouch == false) {
+ if (finger->is_valid) {
+ input_report_abs(input_dev, ABS_X, finger->x);
+ input_report_abs(input_dev, ABS_Y, finger->y);
+ input_report_abs(input_dev, ABS_PRESSURE, finger->t);
+ input_report_key(input_dev, BTN_TOUCH, 1);
+ input_sync(input_dev);
+ }
+ } else {
+ /* multi touch protocol */
+ for (i = 0; i < MAX_FINGERS; i++) {
+ if (!finger[i].is_valid)
+ continue;
+
+ input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, finger[i].t);
+ input_report_abs(input_dev, ABS_MT_POSITION_X, finger[i].x);
+ input_report_abs(input_dev, ABS_MT_POSITION_Y, finger[i].y);
+ input_mt_sync(input_dev);
+ count++;
+ }
+
+ /* SYN_MT_REPORT only if no contact */
+ if (!count) {
+ input_mt_sync(input_dev);
+ if (ts->low_latency_req.dev) {
+ dev_pm_qos_remove_request(&ts->low_latency_req);
+ ts->low_latency_req.dev = NULL;
+ }
+ } else if (!ts->low_latency_req.dev) {
+ /* First contact, request 100 us latency. */
+ dev_pm_qos_add_ancestor_request(&ts->client->dev, &ts->low_latency_req, 100);
+ }
+
+ /* SYN_REPORT */
+ input_sync(input_dev);
+ }
end:
- return IRQ_HANDLED;
+ if (multitouch == false) {
+ /* start polling for st1232_ts_read_data to detect release */
+ schedule_delayed_work(&ts->work, msecs_to_jiffies(SAMPLE_DELAY));
+ }
+
+ return IRQ_HANDLED;
}
static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron)
{
- if (gpio_is_valid(ts->reset_gpio))
- gpio_direction_output(ts->reset_gpio, poweron);
+ if (gpio_is_valid(ts->reset_gpio))
+ gpio_direction_output(ts->reset_gpio, poweron);
}
static int st1232_ts_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
- struct st1232_ts_data *ts;
- struct st1232_pdata *pdata = dev_get_platdata(&client->dev);
- struct input_dev *input_dev;
- int error;
-
- if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
- dev_err(&client->dev, "need I2C_FUNC_I2C\n");
- return -EIO;
- }
-
- if (!client->irq) {
- dev_err(&client->dev, "no IRQ?\n");
- return -EINVAL;
- }
-
- ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL);
- if (!ts)
- return -ENOMEM;
-
- input_dev = devm_input_allocate_device(&client->dev);
- if (!input_dev)
- return -ENOMEM;
-
- ts->client = client;
- ts->input_dev = input_dev;
-
- if (pdata)
- ts->reset_gpio = pdata->reset_gpio;
- else if (client->dev.of_node)
- ts->reset_gpio = of_get_gpio(client->dev.of_node, 0);
- else
- ts->reset_gpio = -ENODEV;
-
- if (gpio_is_valid(ts->reset_gpio)) {
- error = devm_gpio_request(&client->dev, ts->reset_gpio, NULL);
- if (error) {
- dev_err(&client->dev,
- "Unable to request GPIO pin %d.\n",
- ts->reset_gpio);
- return error;
- }
- }
-
- st1232_ts_power(ts, true);
-
- input_dev->name = "st1232-touchscreen";
- input_dev->id.bustype = BUS_I2C;
- input_dev->dev.parent = &client->dev;
-
- __set_bit(EV_SYN, input_dev->evbit);
- __set_bit(EV_KEY, input_dev->evbit);
- __set_bit(EV_ABS, input_dev->evbit);
-
- input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0);
- input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0);
- input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0);
-
- error = devm_request_threaded_irq(&client->dev, client->irq,
- NULL, st1232_ts_irq_handler,
- IRQF_ONESHOT,
- client->name, ts);
- if (error) {
- dev_err(&client->dev, "Failed to register interrupt\n");
- return error;
- }
-
- error = input_register_device(ts->input_dev);
- if (error) {
- dev_err(&client->dev, "Unable to register %s input device\n",
- input_dev->name);
- return error;
- }
-
- i2c_set_clientdata(client, ts);
- device_init_wakeup(&client->dev, 1);
-
- return 0;
+ struct st1232_ts_data *ts;
+ struct st1232_pdata *pdata = dev_get_platdata(&client->dev);
+ struct input_dev *input_dev;
+ int error;
+
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ dev_err(&client->dev, "need I2C_FUNC_I2C\n");
+ return -EIO;
+ }
+
+ if (!client->irq) {
+ dev_err(&client->dev, "no IRQ?\n");
+ return -EINVAL;
+ }
+
+ ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL);
+ if (!ts)
+ return -ENOMEM;
+
+ input_dev = devm_input_allocate_device(&client->dev);
+ if (!input_dev)
+ return -ENOMEM;
+
+ ts->client = client;
+ ts->input_dev = input_dev;
+
+ if (pdata)
+ ts->reset_gpio = pdata->reset_gpio;
+ else if (client->dev.of_node)
+ ts->reset_gpio = of_get_gpio(client->dev.of_node, 0);
+ else
+ ts->reset_gpio = -ENODEV;
+
+ if (gpio_is_valid(ts->reset_gpio)) {
+ error = devm_gpio_request(&client->dev, ts->reset_gpio, NULL);
+ if (error) {
+ dev_err(&client->dev, "Unable to request GPIO pin %d.\n", ts->reset_gpio);
+ return error;
+ }
+ }
+
+ st1232_ts_power(ts, true);
+
+ input_dev->name = ST1232_TS_NAME;
+ input_dev->id.bustype = BUS_I2C;
+ input_dev->dev.parent = &client->dev;
+
+ if (multitouch == false) {
+ input_dev->phys = ST1232_TS_NAME"/input0";
+
+ __set_bit(BTN_TOUCH, input_dev->keybit);
+ __set_bit(EV_KEY, input_dev->evbit);
+ __set_bit(EV_ABS, input_dev->evbit);
+ __set_bit(ABS_X, input_dev->absbit);
+ __set_bit(ABS_Y, input_dev->absbit);
+ __set_bit(ABS_PRESSURE, input_dev->absbit);
+
+ input_set_abs_params(input_dev, ABS_X, MIN_X, MAX_X, 0, 0);
+ input_set_abs_params(input_dev, ABS_Y, MIN_Y, MAX_Y, 0, 0);
+ input_set_abs_params(input_dev, ABS_PRESSURE, 0x0, 0xff, 0, 0);
+
+ INIT_DELAYED_WORK(&ts->work, st1232_ts_finger_released);
+ } else {
+ __set_bit(EV_SYN, input_dev->evbit);
+ __set_bit(EV_KEY, input_dev->evbit);
+ __set_bit(EV_ABS, input_dev->evbit);
+
+ input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0);
+ }
+
+ error = devm_request_threaded_irq(&client->dev, client->irq,
+ NULL, st1232_ts_irq_handler,
+ IRQF_ONESHOT,
+ client->name, ts);
+ if (error) {
+ dev_err(&client->dev, "Failed to register interrupt\n");
+ return error;
+ }
+
+ error = input_register_device(ts->input_dev);
+ if (error) {
+ dev_err(&client->dev, "Unable to register %s input device\n",
+ input_dev->name);
+ return error;
+ }
+
+ i2c_set_clientdata(client, ts);
+ device_init_wakeup(&client->dev, 1);
+
+ return 0;
}
static int st1232_ts_remove(struct i2c_client *client)
{
- struct st1232_ts_data *ts = i2c_get_clientdata(client);
+ struct st1232_ts_data *ts = i2c_get_clientdata(client);
- device_init_wakeup(&client->dev, 0);
- st1232_ts_power(ts, false);
+ device_init_wakeup(&client->dev, 0);
+ st1232_ts_power(ts, false);
+ cancel_delayed_work_sync(&ts->work);
- return 0;
+ return 0;
}
#ifdef CONFIG_PM_SLEEP
static int st1232_ts_suspend(struct device *dev)
{
- struct i2c_client *client = to_i2c_client(dev);
- struct st1232_ts_data *ts = i2c_get_clientdata(client);
-
- if (device_may_wakeup(&client->dev)) {
- enable_irq_wake(client->irq);
- } else {
- disable_irq(client->irq);
- st1232_ts_power(ts, false);
- }
-
- return 0;
+ struct i2c_client *client = to_i2c_client(dev);
+ struct st1232_ts_data *ts = i2c_get_clientdata(client);
+
+ if (device_may_wakeup(&client->dev)) {
+ enable_irq_wake(client->irq);
+ } else {
+ disable_irq(client->irq);
+ cancel_delayed_work_sync(&ts->work);
+ st1232_ts_power(ts, false);
+ }
+
+ return 0;
}
static int st1232_ts_resume(struct device *dev)
{
- struct i2c_client *client = to_i2c_client(dev);
- struct st1232_ts_data *ts = i2c_get_clientdata(client);
-
- if (device_may_wakeup(&client->dev)) {
- disable_irq_wake(client->irq);
- } else {
- st1232_ts_power(ts, true);
- enable_irq(client->irq);
- }
-
- return 0;
+ struct i2c_client *client = to_i2c_client(dev);
+ struct st1232_ts_data *ts = i2c_get_clientdata(client);
+
+ if (device_may_wakeup(&client->dev)) {
+ disable_irq_wake(client->irq);
+ } else {
+ st1232_ts_power(ts, true);
+ schedule_delayed_work(&ts->work, HZ / 50);
+ enable_irq(client->irq);
+ }
+
+ return 0;
}
-
#endif
static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
- st1232_ts_suspend, st1232_ts_resume);
+ st1232_ts_suspend, st1232_ts_resume);
static const struct i2c_device_id st1232_ts_id[] = {
- { ST1232_TS_NAME, 0 },
- { }
+ { ST1232_TS_NAME, 0 },
+ { }
};
MODULE_DEVICE_TABLE(i2c, st1232_ts_id);
#ifdef CONFIG_OF
static const struct of_device_id st1232_ts_dt_ids[] = {
- { .compatible = "sitronix,st1232", },
- { }
+ { .compatible = "sitronix,st1232", },
+ { }
};
MODULE_DEVICE_TABLE(of, st1232_ts_dt_ids);
#endif
static struct i2c_driver st1232_ts_driver = {
- .probe = st1232_ts_probe,
- .remove = st1232_ts_remove,
- .id_table = st1232_ts_id,
- .driver = {
- .name = ST1232_TS_NAME,
- .owner = THIS_MODULE,
- .of_match_table = of_match_ptr(st1232_ts_dt_ids),
- .pm = &st1232_ts_pm_ops,
- },
+ .probe = st1232_ts_probe,
+ .remove = st1232_ts_remove,
+ .id_table = st1232_ts_id,
+ .driver = {
+ .name = ST1232_TS_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(st1232_ts_dt_ids),
+ .pm = &st1232_ts_pm_ops,
+ },
};
module_i2c_driver(st1232_ts_driver);
-MODULE_AUTHOR("Tony SIM <chinyeow.sim.xt@renesas.com>");
-MODULE_DESCRIPTION("SITRONIX ST1232 Touchscreen Controller Driver");
+MODULE_AUTHOR("Tony SIM <chinyeow.sim.xt@renesas.com>, Peter Vicman <peter.vicman@gmail.com>");
+MODULE_DESCRIPTION("SITRONIX ST1232/ST1332 Touchscreen Controller Driver");
MODULE_LICENSE("GPL");
--
1.8.1.2

View File

@ -0,0 +1,320 @@
From 2e1bacff999529c9b91995db5d87ad6708e7d49e Mon Sep 17 00:00:00 2001
From: vpeter4 <peter.vicman@gmail.com>
Date: Wed, 3 Jun 2015 19:09:09 +0200
Subject: [PATCH] Add poweroff driver, enable touchscreen
Use original power_off function from rtc-snvs if set.
Arduino operation is controled by device tree parameter.
From 1bc304cd507fe9eb5673223f0d76ec0aa4ff55f3 Mon Sep 17 00:00:00 2001
From: mxt512 <mtx512@yahoo.co.uk>
Date: Thu, 13 Feb 2014 20:13:27 +0000
Subject: [PATCH] Add poweroff driver.
Existing pm_power_off function was in rtc-snvs. Given we need to reset the SAM3X and turn off
the 5v supply on power down, lets implement a power-off driver to do this for now.
TODO: Not the cleanest solution but it works, should revisit.
Overwriting power_off function with udoo_power_off in case uddo is used.
---
arch/arm/boot/dts/imx6q-udoo.dts | 83 +++++++++++++++++++
drivers/power/reset/Kconfig | 8 ++
drivers/power/reset/Makefile | 1 +
drivers/power/reset/udoo-poweroff.c | 159 ++++++++++++++++++++++++++++++++++++
4 files changed, 251 insertions(+)
create mode 100644 drivers/power/reset/udoo-poweroff.c
diff --git a/arch/arm/boot/dts/imx6q-udoo.dts b/arch/arm/boot/dts/imx6q-udoo.dts
index d4f6acb..078a983 100644
--- a/arch/arm/boot/dts/imx6q-udoo.dts
+++ b/arch/arm/boot/dts/imx6q-udoo.dts
@@ -179,6 +179,78 @@
compatible = "fsl,mxc_v4l2_output";
status = "okay";
};
+
+ poweroff {
+ compatible = "udoo,poweroff";
+ sam3x_rst_gpio = <&gpio1 0 GPIO_ACTIVE_LOW>;
+ pwr_5v_gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;
+ arduino_mode = <0>;
+ };
+};
+
+&ldb {
+ ipu_id = <1>;
+ disp_id = <0>;
+ ext_ref = <1>;
+ mode = "sep0";
+ sec_ipu_id = <1>;
+ sec_disp_id = <1>;
+ status = "okay";
+
+ lvds0: lvds-channel@0 {
+ fsl,data-mapping = "spwg";
+ fsl,data-width = <18>;
+ status = "okay";
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 { /* 60 Hz */
+ clock-frequency = <30000000>;
+ hactive = <800>;
+ vactive = <480>;
+ hback-porch = <50>;
+ hfront-porch = <50>;
+ vback-porch = <21>;
+ vfront-porch = <7>;
+ hsync-len = <60>;
+ vsync-len = <10>;
+ };
+
+ timing1: 1024x768 { /* 60 Hz */
+ /* from u-boot-unico/board/udoo/udoo.c */
+ /* Rif. Panel 1024x768 - UMSH-8596MD-15T - G156XW01V0 */
+ clock-frequency = <65000000>;
+ hactive = <1024>;
+ vactive = <768>;
+ hback-porch = <220>;
+ hfront-porch = <40>;
+ vback-porch = <21>;
+ vfront-porch = <7>;
+ hsync-len = <60>;
+ vsync-len = <10>;
+ de-active = <0>;
+ pixelclk-active = <1>;
+ interlaced = <0>;
+ };
+
+ timing2: 1366x768 { /* 59 Hz */
+ /* from u-boot-unico/board/udoo/udoo.c */
+ /* Rif. 1366x768 Panel CHIMEI M156B3-LA1 */
+ clock-frequency = <72000000>;
+ hactive = <1368>;
+ vactive = <768>;
+ hback-porch = <93>;
+ hfront-porch = <33>;
+ vback-porch = <22>;
+ vfront-porch = <7>;
+ hsync-len = <40>;
+ vsync-len = <4>;
+ de-active = <0>;
+ pixelclk-active = <1>;
+ interlaced = <0>;
+ };
+ };
+ };
};
&hdmi_audio {
@@ -228,6 +300,17 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3_5>;
status = "okay";
+
+ touchscreen: st1232@55 {
+ compatible = "sitronix,st1232";
+ reg = <0x55>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+ /* udoo poweroff driver */
+ lcd_panel_on_gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+ lcd_backlight_gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+ };
};
&fec {
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 6d452a7..1a0620f 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -57,3 +57,11 @@ config POWER_RESET_XGENE
depends on POWER_RESET
help
Reboot support for the APM SoC X-Gene Eval boards.
+
+config POWER_RESET_UDOO
+ bool "UDOO power-off driver"
+ depends on POWER_RESET
+ help
+ This driver supports powering down the UDOO.
+ Say Y if you have a UDOO.
+
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
index a5b4a77..9b8e1b0 100644
--- a/drivers/power/reset/Makefile
+++ b/drivers/power/reset/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
obj-$(CONFIG_POWER_RESET_VEXPRESS) += vexpress-poweroff.o
obj-$(CONFIG_POWER_RESET_XGENE) += xgene-reboot.o
+obj-$(CONFIG_POWER_RESET_UDOO) += udoo-poweroff.o
diff --git a/drivers/power/reset/udoo-poweroff.c b/drivers/power/reset/udoo-poweroff.c
new file mode 100644
index 0000000..b3f8db8
--- /dev/null
+++ b/drivers/power/reset/udoo-poweroff.c
@@ -0,0 +1,159 @@
+/*
+ * UDOO board power off
+ *
+ * Copyright (C) 2014 Jasbir Matharu
+ * Copyright (C) 2015 Peter Vicman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/gpio.h>
+#include <linux/delay.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/of_gpio.h>
+
+#define ARDUINO_MODE_STOPPED 1 /* does arduino starts at boot */
+#define ARDUINO_MODE_LEAVE_POWER 2 /* leave 5V power on after shutdown (to keep arduino reset) */
+
+static void (*pm_power_off_orig)(void) = NULL;
+static int sam3x_rst_gpio = -EINVAL;
+static int pwr_5v_gpio = -EINVAL;
+static u32 arduino_mode = -EINVAL;
+static int lcd_touch_reset_gpio = -EINVAL;
+static int lcd_panel_on_gpio = -EINVAL;
+static int lcd_backlight_gpio = -EINVAL;
+
+static void udoo_set_gpio(unsigned gpio, int value) {
+ int ret;
+
+ if (! gpio_is_valid(gpio))
+ return;
+
+ ret = gpio_direction_output(gpio, value);
+ if (ret)
+ pr_err("%s: gpio %u/%d failed\n", __func__, gpio, value);
+}
+
+static void udoo_request_gpio(struct device *dev, unsigned gpio, unsigned long flags, const char *label) {
+ int ret;
+
+ if (! gpio_is_valid(gpio))
+ return;
+
+ ret = devm_gpio_request_one(dev, gpio, flags, label);
+ if (ret)
+ dev_err(dev, "request of gpio %s %u failed with %d\n", label, gpio, ret);
+}
+
+static void udoo_power_off(void) {
+ pr_emerg("%s: powering off\n", __func__);
+
+ if (pm_power_off_orig != NULL)
+ pm_power_off_orig();
+
+ udoo_set_gpio(lcd_touch_reset_gpio, 1);
+ udoo_set_gpio(lcd_panel_on_gpio, 0);
+ udoo_set_gpio(lcd_backlight_gpio, 0);
+
+ udoo_set_gpio(sam3x_rst_gpio, 0);
+ msleep(50); /* stop sam3x safely */
+
+ if (gpio_is_valid(pwr_5v_gpio) && (arduino_mode & ARDUINO_MODE_LEAVE_POWER) == 0) {
+ pr_emerg("%s: 5V power down\n", __func__);
+ udoo_set_gpio(pwr_5v_gpio, 1);
+ } else
+ pr_emerg("%s: 5V power still on, sam3x reset\n", __func__);
+}
+
+static int udoo_power_off_probe(struct platform_device *pdev)
+{
+ struct device_node *pwr_off_np;
+ int ret;
+
+ dev_err(&pdev->dev, "%s: power-off probe\n", __func__);
+
+ pwr_off_np = of_find_compatible_node(NULL, NULL, "sitronix,st1232");
+ if (pwr_off_np) {
+ lcd_touch_reset_gpio = of_get_named_gpio(pwr_off_np, "gpios", 0);
+ lcd_panel_on_gpio = of_get_named_gpio(pwr_off_np, "lcd_panel_on_gpio", 0);
+ lcd_backlight_gpio = of_get_named_gpio(pwr_off_np, "lcd_backlight_gpio", 0);
+ of_node_put(pwr_off_np);
+
+ udoo_request_gpio(&pdev->dev, lcd_panel_on_gpio, GPIOF_OUT_INIT_HIGH, "lcd_panel_on_gpio");
+ udoo_request_gpio(&pdev->dev, lcd_backlight_gpio, GPIOF_OUT_INIT_HIGH, "lcd_backlight_gpio");
+
+ ret = gpio_export(lcd_backlight_gpio, false);
+ }
+
+ pwr_off_np = of_find_compatible_node(NULL, NULL, "udoo,poweroff");
+ if (pwr_off_np) {
+ ret = of_property_read_u32(pwr_off_np, "arduino_mode", &arduino_mode);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "%s: arduino mode not found in dtb\n", __func__);
+ arduino_mode = 0;
+ }
+
+ sam3x_rst_gpio = of_get_named_gpio(pwr_off_np, "sam3x_rst_gpio", 0);
+ pwr_5v_gpio = of_get_named_gpio(pwr_off_np, "pwr_5v_gpio", 0);
+ of_node_put(pwr_off_np);
+
+ udoo_request_gpio(&pdev->dev, pwr_5v_gpio, GPIOF_OUT_INIT_LOW, "pwr_5v_gpio");
+
+ if (gpio_is_valid(sam3x_rst_gpio)) {
+ ret = gpio_export(sam3x_rst_gpio, false);
+
+ if (arduino_mode & ARDUINO_MODE_STOPPED) {
+ dev_err(&pdev->dev, "%s: arduino stopped\n", __func__);
+ udoo_set_gpio(sam3x_rst_gpio, 0);
+ } else {
+ dev_err(&pdev->dev, "%s: arduino running\n", __func__);
+ udoo_set_gpio(sam3x_rst_gpio, 1);
+ }
+ }
+
+ pm_power_off_orig = pm_power_off;
+ pm_power_off = udoo_power_off;
+ return 0;
+ }
+
+ /* If a pm_power_off function has already been added, leave it alone */
+ if (pm_power_off != NULL) {
+ dev_err(&pdev->dev, "%s: pm_power_off function already registered\n", __func__);
+ return -EBUSY;
+ }
+
+ return -ENODEV;
+}
+
+static int udoo_power_off_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static const struct of_device_id power_off_dt_ids[] = {
+ { .compatible = "udoo,poweroff", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, power_off_dt_ids);
+
+static struct platform_driver udoo_power_off_driver = {
+ .driver = {
+ .name = "udoo_power_off",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(power_off_dt_ids),
+ },
+ .probe = udoo_power_off_probe,
+ .remove = udoo_power_off_remove,
+};
+module_platform_driver(udoo_power_off_driver);
+
+MODULE_AUTHOR("Jasbir Matharu, Peter Vicman");
+MODULE_DESCRIPTION("UDOO Power off driver v3");
+MODULE_LICENSE("GPL v2");
--
1.8.1.2

View File

@ -1,22 +1,47 @@
#!/usr/bin/env perl
# ----------------------------------------------------------------------
# mkknlimg by Phil Elwell for Raspberry Pi
# based on extract-ikconfig by Dick Streefland
#
# (c) 2009,2010 Dick Streefland <dick@streefland.net>
# (c) 2014,2015 Raspberry Pi (Trading) Limited <info@raspberrypi.org>
#
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
use strict;
use warnings;
use integer;
use constant FLAG_PI => 1;
use constant FLAG_DTOK => 2;
use constant FLAG_DDTK => 4;
use constant FLAG_283X => 8;
my $trailer_magic = 'RPTL';
my $tmpfile1 = "/tmp/mkknlimg_$$.1";
my $tmpfile2 = "/tmp/mkknlimg_$$.2";
my $dtok = 0;
my $ddtk = 0;
my $is_283x = 0;
while ($ARGV[0] =~ /^-/)
while (@ARGV && ($ARGV[0] =~ /^-/))
{
my $arg = shift(@ARGV);
if ($arg eq '--dtok')
{
$dtok = 1;
}
elsif ($arg eq '--ddtk')
{
$ddtk = 1;
}
elsif ($arg eq '--283x')
{
$is_283x = 1;
}
else
{
print ("* Unknown option '$arg'\n");
@ -29,56 +54,68 @@ usage() if (@ARGV != 2);
my $kernel_file = $ARGV[0];
my $out_file = $ARGV[1];
my @wanted_config_lines =
(
'CONFIG_BCM2708_DT'
);
if (! -r $kernel_file)
{
print ("* File '$kernel_file' not found\n");
usage();
}
my @wanted_strings =
(
'bcm2708_fb',
'brcm,bcm2708-pinctrl',
'brcm,bcm2835-gpio',
'of_find_property'
);
my $wanted_configs =
{
'CONFIG_BCM2708_DT' => FLAG_PI | FLAG_DTOK,
'CONFIG_ARCH_BCM2835' => FLAG_PI | FLAG_DTOK | FLAG_283X,
};
my $wanted_strings =
{
'bcm2708_fb' => FLAG_PI,
'brcm,bcm2835-mmc' => FLAG_PI,
'brcm,bcm2835-sdhost' => FLAG_PI,
'brcm,bcm2708-pinctrl' => FLAG_PI | FLAG_DTOK,
'brcm,bcm2835-gpio' => FLAG_PI | FLAG_DTOK,
'brcm,bcm2835-pm-wdt' => FLAG_PI | FLAG_DTOK | FLAG_283X,
'of_overlay_apply' => FLAG_DTOK | FLAG_DDTK,
};
my $res = try_extract($kernel_file, $tmpfile1);
$res = try_decompress('\037\213\010', 'xy', 'gunzip', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\3757zXZ\000', 'abcde', 'unxz --single-stream', -1,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('BZh', 'xy', 'bunzip2', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\135\0\0\0', 'xxx', 'unlzma', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\211\114\132', 'xy', 'lzop -d', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res ||= try_decompress('\037\213\010', 'xy', 'gunzip', 0,
$kernel_file, $tmpfile1, $tmpfile2);
$res ||= try_decompress('\3757zXZ\000', 'abcde', 'unxz --single-stream', -1,
$kernel_file, $tmpfile1, $tmpfile2);
$res ||= try_decompress('BZh', 'xy', 'bunzip2', 0,
$kernel_file, $tmpfile1, $tmpfile2);
$res ||= try_decompress('\135\0\0\0', 'xxx', 'unlzma', 0,
$kernel_file, $tmpfile1, $tmpfile2);
$res ||= try_decompress('\211\114\132', 'xy', 'lzop -d', 0,
$kernel_file, $tmpfile1, $tmpfile2);
$res ||= try_decompress('\002\041\114\030', 'xy', 'lz4 -d', 1,
$kernel_file, $tmpfile1, $tmpfile2);
my $append_trailer;
my $trailer;
my $kver = '?';
$append_trailer = $dtok;
if ($res)
{
print("Version: $res->{''}\n");
$kver = $res->{'kver'} || '?';
my $flags = $res->{'flags'};
print("Version: $kver\n");
$append_trailer = $dtok;
if (!$dtok)
if ($flags & FLAG_PI)
{
if (config_bool($res, 'bcm2708_fb'))
{
$dtok ||= config_bool($res, 'CONFIG_BCM2708_DT');
$dtok ||= config_bool($res, 'brcm,bcm2708-pinctrl');
$dtok ||= config_bool($res, 'brcm,bcm2835-gpio');
$append_trailer = 1;
}
else
{
print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n");
}
$append_trailer = 1;
$dtok ||= ($flags & FLAG_DTOK) != 0;
$is_283x ||= ($flags & FLAG_283X) != 0;
$ddtk ||= ($flags & FLAG_DDTK) != 0;
}
else
{
print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n");
}
}
else
elsif (!$dtok)
{
print ("* Is this a valid kernel? In pass-through mode.\n");
}
@ -86,12 +123,16 @@ else
if ($append_trailer)
{
printf("DT: %s\n", $dtok ? "y" : "n");
printf("DDT: %s\n", $ddtk ? "y" : "n");
printf("283x: %s\n", $is_283x ? "y" : "n");
my @atoms;
push @atoms, [ $trailer_magic, pack('V', 0) ];
push @atoms, [ 'KVer', $res->{''} ];
push @atoms, [ 'KVer', $kver ];
push @atoms, [ 'DTOK', pack('V', $dtok) ];
push @atoms, [ 'DDTK', pack('V', $ddtk) ];
push @atoms, [ '283x', pack('V', $is_283x) ];
$trailer = pack_trailer(\@atoms);
$atoms[0]->[1] = pack('V', length($trailer));
@ -99,17 +140,31 @@ if ($append_trailer)
$trailer = pack_trailer(\@atoms);
}
die "* Failed to open '$kernel_file'\n" if (!open(my $ifh, '<', $kernel_file));
die "* Failed to create '$out_file'\n" if (!open(my $ofh, '>', $out_file));
my $copybuf;
my $ofh;
my $total_len = 0;
while (1)
if ($out_file eq $kernel_file)
{
die "* Failed to open '$out_file' for append\n"
if (!open($ofh, '>>', $out_file));
$total_len = tell($ofh);
}
else
{
die "* Failed to open '$kernel_file'\n"
if (!open(my $ifh, '<', $kernel_file));
die "* Failed to create '$out_file'\n"
if (!open($ofh, '>', $out_file));
my $copybuf;
while (1)
{
my $bytes = sysread($ifh, $copybuf, 64*1024);
last if (!$bytes);
syswrite($ofh, $copybuf, $bytes);
$total_len += $bytes;
}
close($ifh);
}
if ($trailer)
@ -119,7 +174,6 @@ if ($trailer)
syswrite($ofh, $trailer);
}
close($ifh);
close($ofh);
exit($trailer ? 0 : 1);
@ -132,7 +186,7 @@ END {
sub usage
{
print ("Usage: mkknlimg [--dtok] <vmlinux|zImage|bzImage> <outfile>\n");
print ("Usage: mkknlimg [--dtok] [--283x] <vmlinux|zImage|bzImage> <outfile>\n");
exit(1);
}
@ -146,40 +200,9 @@ sub try_extract
chomp($ver);
my $res = { ''=>$ver };
my $string_pattern = '^('.join('|', @wanted_strings).')$';
my @matches = `strings \"$knl\" | grep -E \"$string_pattern\"`;
foreach my $match (@matches)
{
chomp($match);
$res->{$match} = 1;
}
my $config_pattern = '^('.join('|', @wanted_config_lines).')=(.*)$';
my $cf1 = 'IKCFG_ST\037\213\010';
my $cf2 = '0123456789';
my $pos = `tr "$cf1\n$cf2" "\n$cf2=" < "$knl" | grep -abo "^$cf2"`;
if ($pos)
{
$pos =~ s/:.*[\r\n]*$//s;
$pos += 8;
my $err = (system("tail -c+$pos \"$knl\" | zcat > $tmp 2> /dev/null") >> 8);
if (($err == 0) || ($err == 2))
{
if (open(my $fh, '<', $tmp))
{
while (my $line = <$fh>)
{
chomp($line);
$res->{$1} = $2 if ($line =~ /$config_pattern/);
}
close($fh);
}
}
}
my $res = { 'kver'=>$ver };
$res->{'flags'} = strings_to_flags($knl, $wanted_strings) |
configs_to_flags($knl, $tmp, $wanted_configs);
return $res;
}
@ -194,6 +217,7 @@ sub try_decompress
{
chomp($pos);
$pos = (split(/[\r\n]+/, $pos))[$idx];
return undef if (!defined($pos));
$pos =~ s/:.*[\r\n]*$//s;
my $cmd = "tail -c+$pos \"$knl\" | $zcat > $tmp2 2> /dev/null";
my $err = (system($cmd) >> 8);
@ -205,6 +229,59 @@ sub try_decompress
return undef;
}
sub strings_to_flags
{
my ($knl, $strings) = @_;
my $string_pattern = '^('.join('|', keys(%$strings)).')$';
my $flags = 0;
my @matches = `strings \"$knl\" | grep -E \"$string_pattern\"`;
foreach my $match (@matches)
{
chomp($match);
$flags |= $strings->{$match};
}
return $flags;
}
sub configs_to_flags
{
my ($knl, $tmp, $configs) = @_;
my $config_pattern = '^('.join('|', keys(%$configs)).')=(.*)$';
my $cf1 = 'IKCFG_ST\037\213\010';
my $cf2 = '0123456789';
my $flags = 0;
my $pos = `tr "$cf1\n$cf2" "\n$cf2=" < "$knl" | grep -abo "^$cf2"`;
if ($pos)
{
$pos =~ s/:.*[\r\n]*$//s;
$pos += 8;
my $err = (system("tail -c+$pos \"$knl\" | zcat > $tmp 2> /dev/null") >> 8);
if (($err == 0) || ($err == 2))
{
if (open(my $fh, '<', $tmp))
{
while (my $line = <$fh>)
{
chomp($line);
if (($line =~ /$config_pattern/) &&
(($2 eq 'y') || ($2 eq 'm')))
{
$flags |= $configs->{$1};
}
}
close($fh);
}
}
}
return $flags;
}
sub pack_trailer
{
my ($atoms) = @_;
@ -216,9 +293,3 @@ sub pack_trailer
}
return $trailer;
}
sub config_bool
{
my ($configs, $wanted) = @_;
return (($configs->{$wanted} eq 'y') || ($configs->{$wanted} eq '1'));
}