projects/Amlogic: add device trees package

This commit is contained in:
kszaq 2018-01-20 22:53:54 +01:00
parent 9c69416f25
commit 212cde55f0
6 changed files with 87 additions and 63 deletions

View File

@ -9,3 +9,6 @@
# Kernel extra targets to build
KERNEL_UBOOT_EXTRA_TARGET="gxl_p212_1g_lepotato.dtb gxl_p212_2g_lepotato.dtb"
# Additional kernel dependencies
KERNEL_EXTRA_DEPENDS_TARGET="device-trees-amlogic"

View File

@ -1,62 +0,0 @@
diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_1g_lepotato.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_1g_lepotato.dts
new file mode 100644
index 0000000..8272581
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/gxl_p212_1g_lepotato.dts
@@ -0,0 +1,25 @@
+#include "gxl_p212_1g.dts"
+
+/ {
+ leds: gpio_leds {
+ compatible = "gpio-leds";
+
+ system {
+ label = "librecomputer:system-status";
+ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ panic-indicator;
+ };
+
+ blue {
+ label = "librecomputer:blue";
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+
+ gpio_keypad {
+ status = "disabled";
+ };
+
+};
diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_2g_lepotato.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_2g_lepotato.dts
new file mode 100644
index 0000000..75f8bc7
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/gxl_p212_2g_lepotato.dts
@@ -0,0 +1,25 @@
+#include "gxl_p212_2g.dts"
+
+/ {
+ leds: gpio_leds {
+ compatible = "gpio-leds";
+
+ system {
+ label = "librecomputer:system-status";
+ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ panic-indicator;
+ };
+
+ blue {
+ label = "librecomputer:blue";
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+
+ gpio_keypad {
+ status = "disabled";
+ };
+
+};

View File

@ -1,3 +1,6 @@
# Additional kernel dependencies
KERNEL_EXTRA_DEPENDS_TARGET="device-trees-amlogic"
# additional drivers to install:
# for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported,

View File

@ -1,6 +1,9 @@
# Kernel extra targets to build
KERNEL_UBOOT_EXTRA_TARGET="gxm_q200_2g.dtb gxm_q201_1g.dtb gxm_q201_2g.dtb"
# Additional kernel dependencies
KERNEL_EXTRA_DEPENDS_TARGET="device-trees-amlogic"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
OPENGLES="opengl-meson-t82x"

View File

@ -64,7 +64,6 @@
# kernel image name
KERNEL_NAME="kernel.img"
################################################################################
# setup build defaults
################################################################################

View File

@ -0,0 +1,78 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-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="device-trees-amlogic"
PKG_VERSION="8a3cfc7"
PKG_SHA256="377e43f346680ae93bb08120fefaa291ce9e4e7cc2947aae0aeba674d46674b8"
PKG_LICENSE="GPL"
PKG_URL="https://github.com/LibreELEC/device-trees-amlogic/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
make_target() {
# Enter kernel directory
pushd $BUILD/linux-$(kernel_version) > /dev/null
# Device trees already present in kernel tree we want to include
EXTRA_TREES=(gxbb_p201 gxl_p212_1g gxl_p212_2g gxm_q200_2g gxm_q201_1g gxm_q201_2g gxl_p281_1g)
# Add trees to the list
for f in ${EXTRA_TREES[@]}; do
DTB_LIST="$DTB_LIST $f.dtb"
done
# Copy all device trees to kernel source folder and create a list
cp -f $PKG_BUILD/*.dts* arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/
for f in $PKG_BUILD/*.dts; do
DTB_NAME="$(basename $f .dts).dtb"
DTB_LIST="$DTB_LIST $DTB_NAME"
done
# Filter device tree list depending on project
case "$DEVICE" in
S905)
for f in ${DTB_LIST[@]}; do
[[ "$f" == gxbb* ]] || [[ "$f" == gxl* ]] && DTB_LIST_FILTERED="$DTB_LIST_FILTERED $f"
done
;;
S912)
for f in ${DTB_LIST[@]}; do
[[ "$f" == gxm* ]] && DTB_LIST_FILTERED="$DTB_LIST_FILTERED $f"
done
;;
*)
for f in ${DTB_LIST[@]}; do
if listcontains "$KERNEL_UBOOT_EXTRA_TARGET" "$f"; then
DTB_LIST_FILTERED="$DTB_LIST_FILTERED $f"
fi
done
;;
esac
# Compile device trees
LDFLAGS="" make $DTB_LIST_FILTERED
mv arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/*.dtb $PKG_BUILD
popd > /dev/null
}
makeinstall_target() {
mkdir -p $INSTALL/usr/share/bootloader
cp -a $PKG_BUILD/*.dtb $INSTALL/usr/share/bootloader
}