Merge pull request #2286 from kszaq/aml_multidtb

Add a possibility to create multi-image device tree blobs for Amlogic
This commit is contained in:
Radostan Riedel 2017-12-11 14:27:51 +01:00 committed by GitHub
commit 7d31b17b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 6 deletions

View File

@ -36,6 +36,7 @@ case "$LINUX" in
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.10" PKG_PATCH_DIRS="amlogic-3.10"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
;; ;;
amlogic-3.14) amlogic-3.14)
PKG_VERSION="2e193b8" PKG_VERSION="2e193b8"
@ -43,6 +44,7 @@ case "$LINUX" in
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"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
;; ;;
*) *)
PKG_VERSION="4.14.4" PKG_VERSION="4.14.4"
@ -187,9 +189,24 @@ make_target() {
LDFLAGS="" make $KERNEL_TARGET $KERNEL_MAKE_EXTRACMD LDFLAGS="" make $KERNEL_TARGET $KERNEL_MAKE_EXTRACMD
if [ "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then if [ "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then
DTB_BLOBS=($(ls arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/*.dtb 2>/dev/null || true))
DTB_BLOBS_COUNT="${#DTB_BLOBS[@]}"
DTB_BLOB_OUTPUT="arch/$TARGET_KERNEL_ARCH/boot/dtb.img"
ANDROID_BOOTIMG_SECOND="--second $DTB_BLOB_OUTPUT"
if [ "$DTB_BLOBS_COUNT" -gt 1 ]; then
$TOOLCHAIN/bin/dtbTool -o arch/$TARGET_KERNEL_ARCH/boot/dtb.img -p scripts/dtc/ arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/
elif [ "$DTB_BLOBS_COUNT" -eq 1 ]; then
cp -PR $DTB_BLOBS $DTB_BLOB_OUTPUT
else
ANDROID_BOOTIMG_SECOND=""
fi
LDFLAGS="" mkbootimg --kernel arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET --ramdisk $BUILD/image/initramfs.cpio \ LDFLAGS="" mkbootimg --kernel arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET --ramdisk $BUILD/image/initramfs.cpio \
$ANDROID_BOOTIMG_OPTIONS --output arch/$TARGET_KERNEL_ARCH/boot/boot.img $ANDROID_BOOTIMG_SECOND $ANDROID_BOOTIMG_OPTIONS --output arch/$TARGET_KERNEL_ARCH/boot/boot.img
mv -f arch/$TARGET_KERNEL_ARCH/boot/boot.img arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET mv -f arch/$TARGET_KERNEL_ARCH/boot/boot.img arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET
fi fi
} }

View File

@ -0,0 +1,35 @@
################################################################################
# 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="aml-dtbtools"
PKG_VERSION="cce100f"
PKG_SHA256="8bcaa83fcc9e85c9c04930e7411447d96a97da0809c5ecd9af91c8b554133c41"
PKG_ARCH="any"
PKG_LICENSE="free"
PKG_SITE="https://github.com/Wilhansen/aml-dtbtools"
PKG_URL="https://github.com/Wilhansen/aml-dtbtools/archive/${PKG_VERSION}.tar.gz"
PKG_SECTION="tools"
PKG_SHORTDESC="AML DTB Tools"
PKG_LONGDESC="AML DTB Tools"
PKG_MAKE_OPTS_HOST="dtbTool"
makeinstall_host() {
mkdir -p $TOOLCHAIN/bin
cp dtbTool $TOOLCHAIN/bin
}

View File

@ -57,9 +57,6 @@
# Build Android kernel image using mkbootimg # Build Android kernel image using mkbootimg
BUILD_ANDROID_BOOTIMG="yes" BUILD_ANDROID_BOOTIMG="yes"
# Additional options to be passed to Android mkbootimg
ANDROID_BOOTIMG_OPTIONS="--second arch/arm/boot/dts/amlogic/meson8m2_wetek_core.dtb"
# 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=""

View File

@ -55,7 +55,7 @@
BUILD_ANDROID_BOOTIMG="yes" BUILD_ANDROID_BOOTIMG="yes"
# Additional options to be passed to Android mkbootimg # Additional options to be passed to Android mkbootimg
ANDROID_BOOTIMG_OPTIONS="--second arch/arm64/boot/dts/amlogic/gxbb_p200_1G_wetek_hub.dtb --base 0x0 --kernel_offset 0x1080000" ANDROID_BOOTIMG_OPTIONS="--base 0x0 --kernel_offset 0x1080000"
# 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=""

View File

@ -55,7 +55,7 @@
BUILD_ANDROID_BOOTIMG="yes" BUILD_ANDROID_BOOTIMG="yes"
# Additional options to be passed to Android mkbootimg # Additional options to be passed to Android mkbootimg
ANDROID_BOOTIMG_OPTIONS="--second arch/arm64/boot/dts/amlogic/gxbb_p200_2G_wetek_play_2.dtb --base 0x0 --kernel_offset 0x1080000" ANDROID_BOOTIMG_OPTIONS="--base 0x0 --kernel_offset 0x1080000"
# 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=""