Merge pull request #2411 from kszaq/le90_s912

projects/Amlogic: add S912 support
This commit is contained in:
Christian Hewitt 2018-01-20 05:48:16 +04:00 committed by GitHub
commit afe4f731f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 246 additions and 56 deletions

View File

@ -20,11 +20,10 @@ PKG_NAME="gpu-aml"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="http://openlinux.amlogic.com:8000/download/ARM/gpu/"
# r5p1
PKG_VERSION="9b0fbbc"
PKG_SHA256="7ca380052b285598f1c0100cec3411f69674dcfc0f78bc2dbe407aaf85b8ebd7"
PKG_URL="https://github.com/openwetek/gpu-aml/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="gpu-aml-$PKG_VERSION*"
PKG_VERSION="fe7a4d8"
PKG_SHA256="518f855a2b191e50d09c2d0b3e671b5ed4b5e4db06aa3a718e29ef30cc0d9a57"
PKG_URL="https://github.com/khadas/android_hardware_arm_gpu/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="android_hardware_arm_gpu-$PKG_VERSION*"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SECTION="driver"
@ -33,13 +32,40 @@ PKG_LONGDESC="gpu-aml: Linux drivers for Mali GPUs found in Amlogic Meson SoCs"
PKG_TOOLCHAIN="manual"
PKG_IS_KERNEL_PKG="yes"
PKG_UTGARD_VERSION="r5p1"
PKG_UTGARD_BUILD_DIR="$PKG_BUILD/utgard/$PKG_UTGARD_VERSION"
PKG_MIDGARD_VERSION="r16p0"
PKG_MIDGARD_BUILD_DIR="$PKG_BUILD/midgard/$PKG_MIDGARD_VERSION/kernel/drivers/gpu/arm/midgard"
pre_configure_target() {
sed -e "s|shell date|shell date -R|g" -i $PKG_BUILD/utgard/*/Kbuild
sed -e "s|USING_GPU_UTILIZATION=1|USING_GPU_UTILIZATION=0|g" -i $PKG_BUILD/utgard/platform/Kbuild.amlogic
}
pre_make_target() {
ln -s $PKG_BUILD/utgard/platform $PKG_UTGARD_BUILD_DIR/platform
}
make_target() {
LDFLAGS="" make -C $(kernel_path) M=$PKG_BUILD/mali \
CONFIG_MALI400=m CONFIG_MALI450=m
if [ "$MESON_FAMILY" = "gxm" ] ; then
LDFLAGS="" make -C $(kernel_path) M=$PKG_MIDGARD_BUILD_DIR \
EXTRA_CFLAGS="-DCONFIG_MALI_PLATFORM_DEVICETREE -DCONFIG_MALI_BACKEND=gpu" \
CONFIG_MALI_MIDGARD=m CONFIG_MALI_PLATFORM_DEVICETREE=y CONFIG_MALI_BACKEND=gpu modules
else
LDFLAGS="" make -C $(kernel_path) M=$PKG_UTGARD_BUILD_DIR \
EXTRA_CFLAGS="-DCONFIG_MALI450=y" \
CONFIG_MALI400=m CONFIG_MALI450=y
fi
}
makeinstall_target() {
LDFLAGS="" make -C $(kernel_path) M=$PKG_BUILD/mali \
INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) INSTALL_MOD_STRIP=1 DEPMOD=: \
modules_install
if [ "$MESON_FAMILY" = "gxm" ] ; then
LDFLAGS="" make -C $(kernel_path) M=$PKG_MIDGARD_BUILD_DIR \
INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) INSTALL_MOD_STRIP=1 DEPMOD=: \
modules_install
else
LDFLAGS="" make -C $(kernel_path) M=$PKG_UTGARD_BUILD_DIR \
INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) INSTALL_MOD_STRIP=1 DEPMOD=: \
modules_install
fi
}

View File

@ -1,13 +0,0 @@
diff --git a/mali/Kbuild.orig b/mali/Kbuild
index 7cc2225..4813c2f 100755
--- a/mali/Kbuild.orig
+++ b/mali/Kbuild
@@ -56,7 +56,7 @@ ifeq ($(CONFIG_MALI_DVFS),y)
USING_GPU_UTILIZATION=0
USING_DVFS=1
else
- USING_GPU_UTILIZATION=1
+ USING_GPU_UTILIZATION=0
USING_DVFS=0
endif
PROFILING_SKIP_PP_JOBS ?= 0

View File

@ -1,13 +0,0 @@
diff --git a/mali/Kbuild b/mali/Kbuild
index 7cc2225..6ce6270 100755
--- a/mali/Kbuild
+++ b/mali/Kbuild
@@ -312,7 +312,7 @@ VERSION_STRINGS += REPO_URL=$(REPO_URL)
VERSION_STRINGS += REVISION=$(DRIVER_REV)
VERSION_STRINGS += CHANGED_REVISION=$(CHANGED_REVISION)
VERSION_STRINGS += CHANGE_DATE=$(CHANGE_DATE)
-VERSION_STRINGS += BUILD_DATE=$(shell date)
+VERSION_STRINGS += BUILD_DATE=$(shell date -R)
ifdef CONFIG_MALI400_DEBUG
VERSION_STRINGS += BUILD=debug
else

View File

@ -9,15 +9,3 @@
# Kernel extra targets to build
KERNEL_UBOOT_EXTRA_TARGET="gxl_p212_1g_lepotato.dtb gxl_p212_2g_lepotato.dtb"
# additional drivers to install:
# for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="gpu-aml"
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
# Space separated list is supported,
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
FIRMWARE=""

View File

@ -2,9 +2,4 @@
# for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS gpu-aml fd628-aml"
# additional packages to install:
# Space separated list is supported,
# e.g. ADDITIONAL_PACKAGES="PACKAGE1 PACKAGE2"
ADDITIONAL_PACKAGES="u-boot-tools-aml"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS fd628-aml"

View File

@ -0,0 +1,9 @@
[Unit]
Description=Set minimum frequency to 1GHz for both CPU clusters
[Service]
Type=simple
ExecStart=-/usr/bin/sh -c 'echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; echo 1000000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq'
[Install]
WantedBy=basic.target

View File

@ -0,0 +1,8 @@
# Kernel extra targets to build
KERNEL_UBOOT_EXTRA_TARGET="gxm_q200_2g.dtb gxm_q201_1g.dtb gxm_q201_2g.dtb"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
OPENGLES="opengl-meson-t82x"
# Amlogic Meson SOC family (8 / 6 / gxbb)
MESON_FAMILY="gxm"

View File

@ -0,0 +1,29 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="android-headers"
PKG_VERSION="25"
PKG_SHA256="1e0ecdf56c33aaa523109254e2c475878d8cfc5795ebd4bb5ecbaf80926f4fe9"
PKG_ARCH="any"
PKG_LICENSE="Apache"
PKG_SITE="https://android.googlesource.com/"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="devel"
PKG_SHORTDESC="android-headers: Android Platform Headers from AOSP releases"
PKG_TOOLCHAIN="manual"

View File

@ -0,0 +1,36 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="libhybris"
PKG_VERSION="070c3ab"
PKG_SHA256="070dcf48aa424c1c56c1d95f5116051a22a76bd5ac0c877febf04b63d9559ea2"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/libhybris/libhybris"
PKG_URL="https://github.com/libhybris/libhybris/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="$PKG_NAME-$PKG_VERSION*/hybris"
PKG_DEPENDS_TARGET="toolchain android-headers"
PKG_SECTION="devel"
PKG_SHORTDESC="libhybris: Allows to run bionic-based HW adaptations in glibc systems - libs"
PKG_TOOLCHAIN="autotools"
PKG_CONFIGURE_OPTS_TARGET="--enable-arch=$TARGET_ARCH \
--with-default-egl-platform=fbdev \
--with-android-headers=$BUILD/android-headers-25 \
--with-default-hybris-ld-library-path=/system/lib \
--enable-mali-quirks"

View File

@ -0,0 +1,19 @@
diff --git a/Makefile.am b/Makefile.am
index 906140e..75888ae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,13 +6,7 @@ endif
if HAS_ANDROID_5_0_0
SUBDIRS += libsync
endif
-SUBDIRS += egl glesv1 glesv2 ui sf input camera vibrator media wifi
-
-if HAS_LIBNFC_NXP_HEADERS
-SUBDIRS += libnfc_nxp libnfc_ndef_nxp
-endif
-SUBDIRS += utils tests
-
+SUBDIRS += egl glesv1 glesv2
MAINTAINERCLEANFILES = \
aclocal.m4 compile config.guess config.sub \

View File

@ -0,0 +1,51 @@
From bd11dbc285303c0fe4039b5058360f38c5614cae Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Tue, 16 Jan 2018 23:41:52 +0100
Subject: [PATCH] eglplatform_fbdev: open new framebuffer when creating a
window
Framebuffer device has to be reopened when creating a new window
to adapt its size to display. This is required e.g. after screen
resolution changed.
---
hybris/egl/platforms/fbdev/eglplatform_fbdev.cpp | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/egl/platforms/fbdev/eglplatform_fbdev.cpp b/egl/platforms/fbdev/eglplatform_fbdev.cpp
index c25a2d7..c75073f 100644
--- a/egl/platforms/fbdev/eglplatform_fbdev.cpp
+++ b/egl/platforms/fbdev/eglplatform_fbdev.cpp
@@ -29,13 +29,6 @@ extern "C" void fbdevws_init_module(struct ws_egl_interface *egl_iface)
assert(0);
}
- err = framebuffer_open((hw_module_t *) gralloc, &framebuffer);
- if (err) {
- fprintf(stderr, "ERROR: failed to open framebuffer: (%s)\n",strerror(-err));
- assert(0);
- }
- TRACE("** framebuffer_open: status=(%s) format=x%x", strerror(-err), framebuffer->format);
-
err = gralloc_open((const hw_module_t *) gralloc, &alloc);
if (err) {
fprintf(stderr, "ERROR: failed to open gralloc: (%s)\n",strerror(-err));
@@ -66,6 +59,16 @@ extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, _EG
assert (gralloc != NULL);
assert (_nativewindow == NULL);
+ if (framebuffer)
+ framebuffer_close(framebuffer);
+
+ int err = framebuffer_open((hw_module_t *) gralloc, &framebuffer);
+ if (err) {
+ fprintf(stderr, "ERROR: failed to open framebuffer: (%s)\n",strerror(-err));
+ assert(0);
+ }
+ TRACE("** framebuffer_open: status=(%s) format=x%x", strerror(-err), framebuffer->format);
+
_nativewindow = new FbDevNativeWindow(alloc, framebuffer);
_nativewindow->common.incRef(&_nativewindow->common);
return (EGLNativeWindowType) static_cast<struct ANativeWindow *>(_nativewindow);
--
2.7.4

View File

@ -0,0 +1,40 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="opengl-meson-t82x"
PKG_VERSION="915cb48"
PKG_SHA256="9b5f65afa21250b67578c250da030a5829e69131ce91b2f167b01b1ed30be781"
PKG_ARCH="arm"
PKG_LICENSE="nonfree"
PKG_SITE="https://github.com/kszaq/opengl-meson-t82x"
PKG_URL="https://github.com/kszaq/opengl-meson-t82x/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain libhybris"
PKG_SOURCE_DIR="$PKG_NAME-$PKG_VERSION*"
PKG_SECTION="graphics"
PKG_SHORTDESC="opengl-meson: OpenGL ES pre-compiled libraries for Mali GPUs found in Amlogic Meson SoCs"
PKG_LONGDESC="opengl-meson: OpenGL ES pre-compiled libraries for Mali GPUs found in Amlogic Meson SoCs. The libraries were extracted from Khadas VIM2 Android firmware."
PKG_TOOLCHAIN="manual"
makeinstall_target() {
mkdir -p $INSTALL/system
cp -a system/* $INSTALL/system
}
post_install() {
enable_service unbind-console.service
}

View File

@ -0,0 +1,11 @@
[Unit]
Description=Unbind framebuffer console
ConditionPathExists=/sys/class/vtconsole/vtcon1/bind
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 0 > /sys/class/vtconsole/vtcon1/bind'
[Install]
WantedBy=graphical.target

View File

@ -112,7 +112,7 @@
# for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="RTL8192CU RTL8192DU RTL8192EU RTL8812AU \
ADDITIONAL_DRIVERS="gpu-aml RTL8192CU RTL8192DU RTL8192EU RTL8812AU \
ap6xxx-aml mt7601u-aml mt7603u-aml qca9377-aml \
RTL8188EU-aml RTL8189ES-aml RTL8189FS-aml RTL8723BS-aml \
RTL8723DS-aml RTL8822BU-aml ssv6xxx-aml"
@ -142,3 +142,8 @@
# for a list of additinoal drivers see packages/linux-driver-addons
# Space separated list is supported,
DRIVER_ADDONS=""
# additional packages to install:
# Space separated list is supported,
# e.g. ADDITIONAL_PACKAGES="PACKAGE1 PACKAGE2"
ADDITIONAL_PACKAGES="u-boot-tools-aml"