mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
u-boot: add hardkernel specific version
This commit is contained in:
parent
4055c9d362
commit
23b6d51063
@ -17,18 +17,23 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="u-boot"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
|
||||
PKG_VERSION="imx6-408544d"
|
||||
PKG_SITE="http://imx.solid-run.com/wiki/index.php?title=Building_the_kernel_and_u-boot_for_the_CuBox-i_and_the_HummingBoard"
|
||||
# https://github.com/SolidRun/u-boot-imx6.git
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
elif [ "$UBOOT_VERSION" = "hardkernel" ]; then
|
||||
PKG_VERSION="502b13b"
|
||||
PKG_SITE="https://github.com/hardkernel/u-boot"
|
||||
PKG_URL="https://github.com/hardkernel/u-boot/archive/$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gcc-linaro-aarch64-none-elf:host"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="arm"
|
||||
PKG_ARCH="arm aarch64"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="tools"
|
||||
PKG_SHORTDESC="u-boot: Universal Bootloader project"
|
||||
@ -61,9 +66,16 @@ make_target() {
|
||||
done
|
||||
|
||||
for UBOOT_TARGET in $UBOOT_CONFIG; do
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH="$TARGET_ARCH" mrproper
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH="$TARGET_ARCH" $UBOOT_TARGET
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH="$TARGET_ARCH" HOSTCC="$HOST_CC" HOSTSTRIP="true"
|
||||
if [ "$PROJECT" = "Odroid_C2" ]; then
|
||||
export PATH=$ROOT/$TOOLCHAIN/lib/gcc-linaro-aarch64-none-elf/bin/:$PATH
|
||||
make CROSS_COMPILE=aarch64-none-elf- ARCH=arm mrproper
|
||||
make CROSS_COMPILE=aarch64-none-elf- ARCH=arm $UBOOT_TARGET
|
||||
make CROSS_COMPILE=aarch64-none-elf- ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true"
|
||||
else
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm mrproper
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm $UBOOT_TARGET
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true"
|
||||
fi
|
||||
|
||||
# rename files in case of multiple targets
|
||||
if [ $UBOOT_TARGET_CNT -gt 1 ]; then
|
||||
@ -106,13 +118,22 @@ makeinstall_target() {
|
||||
|
||||
mkdir -p $INSTALL/usr/share/bootloader
|
||||
|
||||
cp ./u-boot*.imx $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp ./u-boot*.img $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp ./SPL* $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp $ROOT/$PKG_BUILD/u-boot*.imx $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp $ROOT/$PKG_BUILD/u-boot*.img $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp $ROOT/$PKG_BUILD/SPL* $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
cp ./$UBOOT_CONFIGFILE $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
cp -PRv $PKG_DIR/scripts/update.sh $INSTALL/usr/share/bootloader
|
||||
cp $ROOT/$PKG_BUILD/$UBOOT_CONFIGFILE $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
cp -PR $PROJECT_DIR/$PROJECT/bootloader/uEnv*.txt $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
case $PROJECT in
|
||||
Odroid_C2)
|
||||
cp -PRv $PKG_DIR/scripts/update-c2.sh $INSTALL/usr/share/bootloader/update.sh
|
||||
cp -PRv $ROOT/$PKG_BUILD/sd_fuse/bl1.bin.hardkernel $INSTALL/usr/share/bootloader/bl1
|
||||
cp -PRv $ROOT/$PKG_BUILD/sd_fuse/u-boot.bin $INSTALL/usr/share/bootloader/u-boot
|
||||
;;
|
||||
imx6)
|
||||
cp -PRv $PKG_DIR/scripts/update.sh $INSTALL/usr/share/bootloader
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -25,7 +25,10 @@ if [ -z "$UBOOT_CONFIGFILE" ]; then
|
||||
fi
|
||||
|
||||
mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -PR $BUILD/u-boot-*/$UBOOT_CONFIGFILE $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
if [ -e $BUILD/u-boot-*/$UBOOT_CONFIGFILE ]; then
|
||||
cp -PR $BUILD/u-boot-*/$UBOOT_CONFIGFILE $RELEASE_DIR/3rdparty/bootloader
|
||||
fi
|
||||
|
||||
cp -PR $BUILD/u-boot-*/SPL* $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
cp -PR $BUILD/u-boot-*/u-boot*.imx $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
cp -PR $BUILD/u-boot-*/u-boot*.img $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
@ -35,3 +38,11 @@ mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -PR $HOME/.openelec/projects/$PROJECT/bootloader/* $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
|
||||
cp -PR $BUILD/linux-*/arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
|
||||
case $PROJECT in
|
||||
Odroid_C2)
|
||||
cp -PR $BUILD/$BOOTLOADER-*/sd_fuse/bl1.bin.hardkernel $RELEASE_DIR/3rdparty/bootloader/bl1
|
||||
cp -PR $BUILD/$BOOTLOADER-*/sd_fuse/u-boot.bin $RELEASE_DIR/3rdparty/bootloader/u-boot
|
||||
cp -PR $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader
|
||||
;;
|
||||
esac
|
||||
|
55
packages/tools/u-boot/scripts/update-c2.sh
Normal file
55
packages/tools/u-boot/scripts/update-c2.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - https://libreelec.tv
|
||||
# Copyright (C) 2016 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/>.
|
||||
################################################################################
|
||||
|
||||
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
||||
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
||||
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
||||
if [ -z "$BOOT_DISK" ]; then
|
||||
case $BOOT_PART in
|
||||
/dev/sd[a-z][0-9]*)
|
||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
||||
;;
|
||||
/dev/mmcblk*)
|
||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/w
|
||||
mount -o remount,rw $BOOT_ROOT
|
||||
|
||||
# update Device Tree Blobs
|
||||
for all_dtb in /flash/*.dtb /flash/DTB; do
|
||||
dtb=$(basename $all_dtb)
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
|
||||
echo "*** updating Device Tree Blob: $dtb ..."
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
|
||||
fi
|
||||
done
|
||||
|
||||
echo "*** updating u-boot for Odroid on: $BOOT_DISK ..."
|
||||
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/bl1 of=$BOOT_DISK conv=fsync bs=1 count=442
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/bl1 of=$BOOT_DISK conv=fsync bs=512 seek=1 skip=1
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=512 seek=97
|
||||
|
||||
# mount $BOOT_ROOT r/o
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
@ -0,0 +1,56 @@
|
||||
diff -Naur a/include/configs/odroidc2.h b/include/configs/odroidc2.h
|
||||
--- a/include/configs/odroidc2.h 2016-03-30 00:48:47.000000000 -0700
|
||||
+++ b/include/configs/odroidc2.h 2016-05-02 11:46:12.581483463 -0700
|
||||
@@ -79,36 +79,24 @@
|
||||
#define CONFIG_SYS_MAXARGS 64
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
- "boardname=ODROIDC2\0" \
|
||||
- "loadaddr=0x20000000\0" \
|
||||
- "dtbaddr=0x1000000\0" \
|
||||
- "fdt_high=0x20000000\0" \
|
||||
- "hdmimode=720p60hz\0" \
|
||||
- "cecconfig=cec0xf\0" \
|
||||
- "bootargs=root=/dev/mmcblk0p2 rw init=/init rootwait " \
|
||||
- "console=ttyS0,115200 " \
|
||||
- "hdmimode=720p60hz hdmitx=cecf " \
|
||||
- "logo=osd1,loaded,0x3f800000,720p60hz " \
|
||||
- "androidboot.hardware=odroidc2 androidboot.serialno=${fbt_id#} " \
|
||||
- "androidboot.selinux=disabled \0" \
|
||||
- "bootcmd=cfgload; showlogo ${hdmimode}; movi read dtb 0 ${dtbaddr}; movi read boot 0 ${loadaddr}; booti ${loadaddr} - ${dtbaddr}\0"
|
||||
+ "bootcmd=cfgload\0"
|
||||
|
||||
#define CONFIG_PREBOOT
|
||||
#define CONFIG_BOOTCOMMAND
|
||||
|
||||
-//#define CONFIG_ENV_IS_NOWHERE 1
|
||||
+#define CONFIG_ENV_IS_NOWHERE 1
|
||||
#define CONFIG_ENV_SIZE (32 * SZ_1K) /* 32kB */
|
||||
#define CONFIG_ENV_OFFSET (720 * SZ_1K) /* FIXME: should be
|
||||
close to U-boot image
|
||||
size to save space */
|
||||
#define CONFIG_FIT 1
|
||||
#define CONFIG_OF_LIBFDT 1
|
||||
-#define CONFIG_ANDROID_BOOT_IMAGE 1
|
||||
-#define CONFIG_ANDROID_IMG 1
|
||||
+//#define CONFIG_ANDROID_BOOT_IMAGE 1
|
||||
+//#define CONFIG_ANDROID_IMG 1
|
||||
#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size*/
|
||||
|
||||
/* Support commands */
|
||||
-#define CONFIG_CMD_SAVEENV 1
|
||||
+//#define CONFIG_CMD_SAVEENV 1
|
||||
#define CONFIG_CMD_CACHE 1
|
||||
#define CONFIG_CMD_BOOTI 1
|
||||
#define CONFIG_CMD_EFUSE 1
|
||||
@@ -176,8 +164,8 @@
|
||||
#define CONFIG_LZO 1
|
||||
|
||||
/* storage: emmc/nand/sd */
|
||||
-#define CONFIG_ENV_OVERWRITE
|
||||
-#define CONFIG_ENV_IS_IN_MMC 1
|
||||
+//#define CONFIG_ENV_OVERWRITE
|
||||
+#define CONFIG_ENV_IS_IN_MMC 0
|
||||
#define CONFIG_SYS_MMC_ENV_DEV 0
|
||||
#define CONFIG_AML_SD_EMMC 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user