mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #2425 from kszaq/aml_device_trees
Add device trees package for Amlogic generic project
This commit is contained in:
commit
c1c3f08b24
@ -21,7 +21,7 @@ PKG_ARCH="any"
|
|||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="http://www.kernel.org"
|
PKG_SITE="http://www.kernel.org"
|
||||||
PKG_DEPENDS_HOST="ccache:host"
|
PKG_DEPENDS_HOST="ccache:host"
|
||||||
PKG_DEPENDS_TARGET="toolchain cpio:host kmod:host pciutils xz:host wireless-regdb keyutils"
|
PKG_DEPENDS_TARGET="toolchain cpio:host kmod:host pciutils xz:host wireless-regdb keyutils $KERNEL_EXTRA_DEPENDS_TARGET"
|
||||||
PKG_DEPENDS_INIT="toolchain"
|
PKG_DEPENDS_INIT="toolchain"
|
||||||
PKG_NEED_UNPACK="$LINUX_DEPENDS"
|
PKG_NEED_UNPACK="$LINUX_DEPENDS"
|
||||||
PKG_SECTION="linux"
|
PKG_SECTION="linux"
|
||||||
@ -39,8 +39,8 @@ case "$LINUX" in
|
|||||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
|
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
|
||||||
;;
|
;;
|
||||||
amlogic-3.14)
|
amlogic-3.14)
|
||||||
PKG_VERSION="7951748"
|
PKG_VERSION="9c63c24"
|
||||||
PKG_SHA256="d90709aae14ac0c2fc64fd8423caa695829dc012f65f42069d27d84095df8137"
|
PKG_SHA256="ca5c17921e554c75a63dd91f400ceaee3657d2b485db93909754891d68ea19d2"
|
||||||
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
|
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
|
||||||
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
|
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
|
||||||
PKG_PATCH_DIRS="amlogic-3.14"
|
PKG_PATCH_DIRS="amlogic-3.14"
|
||||||
@ -223,8 +223,8 @@ makeinstall_target() {
|
|||||||
cp -v $dtb $INSTALL/usr/share/bootloader
|
cp -v $dtb $INSTALL/usr/share/bootloader
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -d arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic -a -f "arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/$KERNEL_UBOOT_EXTRA_TARGET" ]; then
|
if [ -d arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic -a -f arch/$TARGET_KERNEL_ARCH/boot/dtb.img ]; then
|
||||||
cp "arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/$KERNEL_UBOOT_EXTRA_TARGET" $INSTALL/usr/share/bootloader/dtb.img 2>/dev/null || :
|
cp arch/$TARGET_KERNEL_ARCH/boot/dtb.img $INSTALL/usr/share/bootloader/dtb.img 2>/dev/null || :
|
||||||
fi
|
fi
|
||||||
elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then
|
elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then
|
||||||
mkdir -p $INSTALL/usr/share/bootloader/overlays
|
mkdir -p $INSTALL/usr/share/bootloader/overlays
|
||||||
|
@ -25,3 +25,7 @@ for src in $INSTALL_SRC_DIR/*autoscript.src ; do
|
|||||||
mcopy "$LE_TMP/$(basename $src .src)" ::
|
mcopy "$LE_TMP/$(basename $src .src)" ::
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# copy device trees to part1
|
||||||
|
mmd device_trees
|
||||||
|
mcopy $RELEASE_DIR/3rdparty/bootloader/*.dtb ::/device_trees
|
||||||
|
25
projects/Amlogic/bootloader/release
Executable file
25
projects/Amlogic/bootloader/release
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of LibreELEC - https://libreelec.tv
|
||||||
|
# Copyright (C) 2018-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/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. config/options $1
|
||||||
|
|
||||||
|
mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||||
|
cp -a $INSTALL/usr/share/bootloader/*.dtb $RELEASE_DIR/3rdparty/bootloader
|
||||||
|
cp $INSTALL/usr/share/bootloader/dtb.img $RELEASE_DIR/3rdparty/bootloader
|
@ -99,6 +99,12 @@ for arg in $(cat /proc/cmdline); do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -d $BOOT_ROOT/device_trees ]; then
|
||||||
|
mount -o rw,remount $BOOT_ROOT
|
||||||
|
rm $BOOT_ROOT/device_trees/*.dtb
|
||||||
|
cp -p $SYSTEM_ROOT/usr/share/bootloader/*.dtb $BOOT_ROOT/device_trees/
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.ini ]; then
|
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.ini ]; then
|
||||||
echo "*** updating boot.ini ..."
|
echo "*** updating boot.ini ..."
|
||||||
mount -o rw,remount $BOOT_ROOT
|
mount -o rw,remount $BOOT_ROOT
|
@ -9,3 +9,6 @@
|
|||||||
|
|
||||||
# Kernel extra targets to build
|
# Kernel extra targets to build
|
||||||
KERNEL_UBOOT_EXTRA_TARGET="gxl_p212_1g_lepotato.dtb gxl_p212_2g_lepotato.dtb"
|
KERNEL_UBOOT_EXTRA_TARGET="gxl_p212_1g_lepotato.dtb gxl_p212_2g_lepotato.dtb"
|
||||||
|
|
||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET="device-trees-amlogic"
|
||||||
|
@ -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";
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+};
|
|
@ -1,3 +1,6 @@
|
|||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET="device-trees-amlogic"
|
||||||
|
|
||||||
# additional drivers to install:
|
# additional drivers to install:
|
||||||
# for a list of additinoal drivers see packages/linux-drivers
|
# for a list of additinoal drivers see packages/linux-drivers
|
||||||
# Space separated list is supported,
|
# Space separated list is supported,
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
# Kernel extra targets to build
|
# Kernel extra targets to build
|
||||||
KERNEL_UBOOT_EXTRA_TARGET="gxm_q200_2g.dtb gxm_q201_1g.dtb gxm_q201_2g.dtb"
|
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)
|
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
|
||||||
OPENGLES="opengl-meson-t82x"
|
OPENGLES="opengl-meson-t82x"
|
||||||
|
|
||||||
|
@ -54,6 +54,9 @@
|
|||||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
KERNEL_MAKE_EXTRACMD=""
|
KERNEL_MAKE_EXTRACMD=""
|
||||||
|
|
||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||||
|
|
||||||
# Kernel to use. values can be:
|
# Kernel to use. values can be:
|
||||||
# default: default mainline kernel
|
# default: default mainline kernel
|
||||||
LINUX="amlogic-3.14"
|
LINUX="amlogic-3.14"
|
||||||
@ -61,7 +64,6 @@
|
|||||||
# kernel image name
|
# kernel image name
|
||||||
KERNEL_NAME="kernel.img"
|
KERNEL_NAME="kernel.img"
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# setup build defaults
|
# setup build defaults
|
||||||
################################################################################
|
################################################################################
|
||||||
|
78
projects/Amlogic/packages/device-trees-amlogic/package.mk
Normal file
78
projects/Amlogic/packages/device-trees-amlogic/package.mk
Normal 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
|
||||||
|
}
|
@ -36,6 +36,9 @@
|
|||||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
KERNEL_MAKE_EXTRACMD=""
|
KERNEL_MAKE_EXTRACMD=""
|
||||||
|
|
||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||||
|
|
||||||
# Kernel to use. values can be:
|
# Kernel to use. values can be:
|
||||||
# default: default mainline kernel
|
# default: default mainline kernel
|
||||||
LINUX="default"
|
LINUX="default"
|
||||||
|
@ -68,6 +68,9 @@
|
|||||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
KERNEL_MAKE_EXTRACMD="dtbs"
|
KERNEL_MAKE_EXTRACMD="dtbs"
|
||||||
|
|
||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||||
|
|
||||||
# Kernel to use. values can be:
|
# Kernel to use. values can be:
|
||||||
# default: default mainline kernel
|
# default: default mainline kernel
|
||||||
LINUX="default"
|
LINUX="default"
|
||||||
|
@ -60,6 +60,9 @@
|
|||||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
KERNEL_MAKE_EXTRACMD=""
|
KERNEL_MAKE_EXTRACMD=""
|
||||||
|
|
||||||
|
# Additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||||
|
|
||||||
# Kernel to use. values can be:
|
# Kernel to use. values can be:
|
||||||
# default: default mainline kernel
|
# default: default mainline kernel
|
||||||
LINUX="amlogic-3.10"
|
LINUX="amlogic-3.10"
|
||||||
|
@ -57,6 +57,9 @@
|
|||||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
KERNEL_MAKE_EXTRACMD=""
|
KERNEL_MAKE_EXTRACMD=""
|
||||||
|
|
||||||
|
# additional kernel dependencies
|
||||||
|
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||||
|
|
||||||
# Kernel to use. values can be:
|
# Kernel to use. values can be:
|
||||||
# default: default mainline kernel
|
# default: default mainline kernel
|
||||||
LINUX="amlogic-3.10"
|
LINUX="amlogic-3.10"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user