mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
commit
72db171801
@ -141,6 +141,9 @@ setup_toolchain() {
|
||||
export CXX_FOR_BUILD="$CXX"
|
||||
export BUILD_CC="$CC"
|
||||
export BUILD_CXX="$CXX"
|
||||
export _python_sysroot="$TOOLCHAIN"
|
||||
export _python_prefix=/
|
||||
export _python_exec_prefix=/
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -185,12 +185,6 @@ pre_make_target() {
|
||||
|
||||
# regdb
|
||||
cp $(get_build_dir wireless-regdb)/db.txt $PKG_BUILD/net/wireless/db.txt
|
||||
|
||||
if [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
( cd $ROOT
|
||||
$SCRIPTS/build u-boot
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
make_target() {
|
||||
@ -222,8 +216,10 @@ make_target() {
|
||||
makeinstall_target() {
|
||||
if [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
mkdir -p $INSTALL/usr/share/bootloader
|
||||
for dtb in arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb; do
|
||||
cp $dtb $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
for dtb in arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb arch/$TARGET_KERNEL_ARCH/boot/dts/*/*.dtb; do
|
||||
if [ -f $dtb ]; then
|
||||
cp -v $dtb $INSTALL/usr/share/bootloader
|
||||
fi
|
||||
done
|
||||
if [ -d arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic -a -f "arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/$KERNEL_UBOOT_EXTRA_TARGET" ]; then
|
||||
cp "arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/$KERNEL_UBOOT_EXTRA_TARGET" $INSTALL/usr/share/bootloader/dtb.img 2>/dev/null || :
|
||||
|
@ -30,3 +30,5 @@ PKG_LONGDESC="Expat is an XML parser library written in C. It is a stream-orient
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
PKG_CMAKE_OPTS_TARGET="-DBUILD_docs=OFF -DBUILD_tools=OFF -DBUILD_examples=OFF -DBUILD_tests=OFF -DBUILD_shared=ON"
|
||||
PKG_CMAKE_OPTS_HOST="-DBUILD_docs=OFF -DBUILD_tools=OFF -DBUILD_examples=OFF -DBUILD_tests=OFF -DBUILD_shared=ON"
|
||||
|
||||
|
@ -17,27 +17,37 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="dtc"
|
||||
PKG_VERSION="1.4.4"
|
||||
PKG_SHA256="2d1226634d71655466ebbd090d2873068c4918fbd5c433b91ead8ad08b9a5843"
|
||||
PKG_VERSION="1.4.5"
|
||||
PKG_SHA256="cfb9394690ebec1e4f942ee0c3b863b660eb0c4ef85bab19429f30c3469a3415"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://git.kernel.org/pub/scm/utils/dtc/dtc.git/"
|
||||
PKG_URL="https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$PKG_VERSION.tar.gz"
|
||||
PKG_SOURCE_DIR="$PKG_VERSION"
|
||||
PKG_DEPENDS_HOST="Python2:host swig:host"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_SECTION="tools"
|
||||
PKG_SHORTDESC="The Device Tree Compiler"
|
||||
PKG_LONGDESC="The Device Tree Compiler"
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
PKG_MAKE_OPTS_TARGET="dtc"
|
||||
PKG_MAKE_OPTS_HOST="dtc libfdt"
|
||||
PKG_MAKE_OPTS_TARGET="dtc libfdt"
|
||||
|
||||
makeinstall_host() {
|
||||
mkdir -p $TOOLCHAIN/bin
|
||||
cp -P $PKG_BUILD/dtc $TOOLCHAIN/bin
|
||||
cp -P $PKG_BUILD/libfdt/libfdt.so $TOOLCHAIN/lib
|
||||
}
|
||||
|
||||
post_makeinstall_host() {
|
||||
python ./pylibfdt/setup.py build_ext --inplace
|
||||
python ./pylibfdt/setup.py install --prefix=$TOOLCHAIN
|
||||
|
||||
touch $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/site-packages/pylibfdt/__init__.py
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp -P $PKG_BUILD/dtc $INSTALL/usr/bin
|
||||
}
|
||||
|
||||
makeinstall_host() {
|
||||
mkdir -p $TOOLCHAIN/bin
|
||||
cp -P $PKG_BUILD/dtc $TOOLCHAIN/bin
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
diff -Naur a/Makefile b/Makefile
|
||||
--- a/Makefile 2017-03-09 16:17:23.000000000 -0800
|
||||
+++ b/Makefile 2017-05-31 16:04:29.052439734 -0700
|
||||
@@ -134,7 +134,7 @@
|
||||
LIBFDT_objdir = libfdt
|
||||
LIBFDT_srcdir = libfdt
|
||||
LIBFDT_archive = $(LIBFDT_objdir)/libfdt.a
|
||||
-LIBFDT_lib = $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
|
||||
+LIBFDT_lib = $(LIBFDT_objdir)/libfdt.$(SHAREDLIB_EXT)
|
||||
LIBFDT_include = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_INCLUDES))
|
||||
LIBFDT_version = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_VERSION))
|
||||
|
@ -1,103 +0,0 @@
|
||||
################################################################################
|
||||
# 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="u-boot-v2"
|
||||
PKG_VERSION="2017.01"
|
||||
PKG_SHA256="6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2"
|
||||
PKG_SITE=""
|
||||
PKG_URL="ftp://ftp.denx.de/pub/u-boot/u-boot-$PKG_VERSION.tar.bz2"
|
||||
PKG_SOURCE_DIR="u-boot-$PKG_VERSION"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_ARCH="arm"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SECTION="tools"
|
||||
PKG_SHORTDESC="u-boot: Universal Bootloader project"
|
||||
PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems, used as the default boot loader by several board vendors. It is intended to be easy to port and to debug, and runs on many supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS, and Microblaze."
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
pre_configure_target() {
|
||||
if [ -z "$UBOOT_CONFIG_V2" ]; then
|
||||
echo "$TARGET_PLATFORM does not define any u-boot configuration, aborting."
|
||||
echo "Please add UBOOT_CONFIG_V2 to your project options file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# dont build in parallel because of problems
|
||||
#MAKEFLAGS=-j1
|
||||
# hide compile line
|
||||
KBUILD_VERBOSE=0
|
||||
}
|
||||
|
||||
make_target() {
|
||||
# get number of targets to build
|
||||
UBOOT_TARGET_CNT=0
|
||||
for UBOOT_TARGET in $UBOOT_CONFIG_V2; do
|
||||
UBOOT_TARGET_CNT=$((UBOOT_TARGET_CNT + 1))
|
||||
done
|
||||
|
||||
# renamed files must be in subfolder or they got removed
|
||||
rm -fr tmp_output
|
||||
mkdir tmp_output
|
||||
|
||||
for UBOOT_TARGET in $UBOOT_CONFIG_V2; do
|
||||
echo "$PKG_NAME: building $UBOOT_TARGET"
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" CFLAGS="" LDFLAGS="" ARCH=arm mrproper
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" CFLAGS="" LDFLAGS="" ARCH=arm $UBOOT_TARGET
|
||||
make CROSS_COMPILE="$TARGET_PREFIX" CFLAGS="" LDFLAGS="" ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true"
|
||||
|
||||
# rename files in case of multiple targets
|
||||
if [ $UBOOT_TARGET_CNT -gt 1 ]; then
|
||||
if [ "$UBOOT_TARGET" = "udoo_config" ]; then
|
||||
TARGET_NAME="udoo"
|
||||
elif [ "$UBOOT_TARGET" = "tbs2910_config" ]; then
|
||||
TARGET_NAME="matrix"
|
||||
elif [ "$UBOOT_TARGET" = "wandboard_config" ]; then
|
||||
TARGET_NAME="wandboard"
|
||||
else
|
||||
TARGET_NAME="undef"
|
||||
fi
|
||||
|
||||
[ -f u-boot.img ] && mv u-boot.img tmp_output/u-boot-$TARGET_NAME.img || : #
|
||||
[ -f u-boot.imx ] && mv u-boot.imx tmp_output/u-boot-$TARGET_NAME.imx || : #
|
||||
[ -f SPL ] && mv SPL tmp_output/SPL-$TARGET_NAME || : #
|
||||
fi
|
||||
done
|
||||
|
||||
mv tmp_output/* .
|
||||
rmdir tmp_output
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/share/bootloader
|
||||
|
||||
cp $PKG_BUILD/u-boot-*.imx $INSTALL/usr/share/bootloader 2>/dev/null || : #
|
||||
cp $PKG_BUILD/u-boot-*.img $INSTALL/usr/share/bootloader 2>/dev/null || : #
|
||||
cp $PKG_BUILD/SPL-* $INSTALL/usr/share/bootloader 2>/dev/null || : #
|
||||
}
|
||||
|
||||
pre_install() {
|
||||
# rename tbs matrix binary in main u-boot
|
||||
U_BOOT_MAIN_DIR="$(get_build_dir u-boot)"
|
||||
if [ -f "$U_BOOT_MAIN_DIR/u-boot-matrix.imx" ]; then
|
||||
mv "$U_BOOT_MAIN_DIR/u-boot-matrix.imx" "$U_BOOT_MAIN_DIR/u-boot-matrix-v1.imx" || : #
|
||||
fi
|
||||
|
||||
U_BOOT_MAIN_DIR="$U_BOOT_MAIN_DIR/.install_pkg/usr/share/bootloader"
|
||||
if [ -f "$U_BOOT_MAIN_DIR/u-boot-matrix.imx" ]; then
|
||||
mv "$U_BOOT_MAIN_DIR/u-boot-matrix.imx" "$U_BOOT_MAIN_DIR/u-boot-matrix-v1.imx" || : #
|
||||
fi
|
||||
}
|
@ -1,188 +0,0 @@
|
||||
stuff ported from u-boot-imx6-e817fa3
|
||||
|
||||
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
|
||||
index 0dc4a28..31adfb3 100644
|
||||
--- a/include/configs/tbs2910.h
|
||||
+++ b/include/configs/tbs2910.h
|
||||
@@ -11,6 +11,19 @@
|
||||
|
||||
#include "mx6_common.h"
|
||||
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 1
|
||||
+
|
||||
+#define CONFIG_FS_FAT
|
||||
+#define CONFIG_FS_EXT4
|
||||
+/*#define CONFIG_CMD_FS_GENERIC*/ /* Generic load commands */
|
||||
+/*#define CONFIG_CMD_BOOTZ*/ /* bootz zImage support */
|
||||
+#define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */
|
||||
+/*#define CONFIG_CMD_EXT2*/
|
||||
+/*#define CONFIG_CMD_EXT4*/
|
||||
+/*#define CONFIG_CMD_FAT*/
|
||||
+#define CONFIG_DOS_PARTITION
|
||||
+
|
||||
/* General configuration */
|
||||
#define CONFIG_SYS_THUMB_BUILD
|
||||
|
||||
@@ -151,36 +164,133 @@
|
||||
#define CONFIG_ENV_OVERWRITE
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
- "bootargs_mmc1=console=ttymxc0,115200 di0_primary console=tty1\0" \
|
||||
- "bootargs_mmc2=video=mxcfb0:dev=hdmi,1920x1080M@60 " \
|
||||
- "video=mxcfb1:off video=mxcfb2:off fbmem=28M\0" \
|
||||
- "bootargs_mmc3=root=/dev/mmcblk0p1 rootwait consoleblank=0 quiet\0" \
|
||||
- "bootargs_mmc=setenv bootargs ${bootargs_mmc1} ${bootargs_mmc2} " \
|
||||
- "${bootargs_mmc3}\0" \
|
||||
- "bootargs_upd=setenv bootargs console=ttymxc0,115200 " \
|
||||
- "rdinit=/sbin/init enable_wait_mode=off\0" \
|
||||
- "bootcmd_mmc=run bootargs_mmc; mmc dev 2; " \
|
||||
- "mmc read 0x10800000 0x800 0x4000; bootm 0x10800000\0" \
|
||||
- "bootcmd_up1=load mmc 1 0x10800000 uImage\0" \
|
||||
- "bootcmd_up2=load mmc 1 0x10d00000 uramdisk.img; " \
|
||||
- "run bootargs_upd; " \
|
||||
- "bootm 0x10800000 0x10d00000\0" \
|
||||
- "console=ttymxc0\0" \
|
||||
- "fan=gpio set 92\0" \
|
||||
- "set_con_serial=setenv stdout serial; " \
|
||||
- "setenv stderr serial;\0" \
|
||||
- "set_con_hdmi=setenv stdout serial,vga; " \
|
||||
- "setenv stderr serial,vga;\0" \
|
||||
- "stderr=serial,vga;\0" \
|
||||
- "stdin=serial,usbkbd;\0" \
|
||||
- "stdout=serial,vga;\0"
|
||||
+ "zImage=KERNEL\0" \
|
||||
+ "script=boot.scr\0" \
|
||||
+ "uimage=uImage\0" \
|
||||
+ "fdt_file=imx6q-tbs2910.dtb\0" \
|
||||
+ "fdt_addr=0x18000000\0" \
|
||||
+ "boot_fdt=try\0" \
|
||||
+ "ip_dyn=yes\0" \
|
||||
+ "console=ttymxc0,115200\0" \
|
||||
+ "optargs=\0" \
|
||||
+ "video=\0" \
|
||||
+ "fdt_high=0xffffffff\0" \
|
||||
+ "initrd_high=0xffffffff\0" \
|
||||
+ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
|
||||
+ "mmcpart=1\0" \
|
||||
+ "update_sd_firmware=" \
|
||||
+ "if test ${ip_dyn} = yes; then " \
|
||||
+ "setenv get_cmd dhcp; " \
|
||||
+ "else " \
|
||||
+ "setenv get_cmd tftp; " \
|
||||
+ "fi; " \
|
||||
+ "if mmc dev ${mmcdev}; then " \
|
||||
+ "if ${get_cmd} ${update_sd_firmware_filename}; then " \
|
||||
+ "setexpr fw_sz ${filesize} / 0x200; " \
|
||||
+ "setexpr fw_sz ${fw_sz} + 1; " \
|
||||
+ "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
|
||||
+ "fi; " \
|
||||
+ "fi\0" \
|
||||
+ "mmcroot=/dev/mmcblk0p2 ro\0" \
|
||||
+ "mmcrootfstype=ext4 rootwait fixrtc\0" \
|
||||
+ "mmcargs=setenv bootargs console=${console}" \
|
||||
+ "${optargs} " \
|
||||
+ "root=${mmcroot} " \
|
||||
+ "rootfstype=${mmcrootfstype} " \
|
||||
+ "video=${video}\0" \
|
||||
+ "loadbootscript=" \
|
||||
+ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
+ "bootscript=echo Running bootscript from mmc ...; " \
|
||||
+ "source\0" \
|
||||
+ "loadbootenv=" \
|
||||
+ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt;\0" \
|
||||
+ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
|
||||
+ "env import -t ${loadaddr} ${filesize}\0" \
|
||||
+ "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
|
||||
+ "loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${zImage}\0" \
|
||||
+ "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
+ "mmcboot=echo Booting from mmc ...; " \
|
||||
+ "run mmcargs; " \
|
||||
+ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||
+ "if run loadfdt; then " \
|
||||
+ "bootz ${loadaddr} - ${fdt_addr}; " \
|
||||
+ "else " \
|
||||
+ "if test ${boot_fdt} = try; then " \
|
||||
+ "bootz; " \
|
||||
+ "else " \
|
||||
+ "echo WARN: Cannot load the DT; " \
|
||||
+ "fi; " \
|
||||
+ "fi; " \
|
||||
+ "else " \
|
||||
+ "bootz; " \
|
||||
+ "fi;\0" \
|
||||
+ "netargs=setenv bootargs console=${console},${baudrate} " \
|
||||
+ "root=/dev/nfs " \
|
||||
+ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
|
||||
+ "netboot=echo Booting from net ...; " \
|
||||
+ "run netargs; " \
|
||||
+ "if test ${ip_dyn} = yes; then " \
|
||||
+ "setenv get_cmd dhcp; " \
|
||||
+ "else " \
|
||||
+ "setenv get_cmd tftp; " \
|
||||
+ "fi; " \
|
||||
+ "${get_cmd} ${uimage}; " \
|
||||
+ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||
+ "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
|
||||
+ "bootz ${loadaddr} - ${fdt_addr}; " \
|
||||
+ "else " \
|
||||
+ "if test ${boot_fdt} = try; then " \
|
||||
+ "bootz; " \
|
||||
+ "else " \
|
||||
+ "echo WARN: Cannot load the DT; " \
|
||||
+ "fi; " \
|
||||
+ "fi; " \
|
||||
+ "else " \
|
||||
+ "bootz; " \
|
||||
+ "fi;\0"
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
- "mmc rescan; " \
|
||||
- "if run bootcmd_up1; then " \
|
||||
- "run bootcmd_up2; " \
|
||||
+ "echo; " \
|
||||
+ "echo SD/MMC device set to ${mmcdev} but checking 0, 1 and 2; " \
|
||||
+ "setenv mmcdevold ${mmcdev}; " \
|
||||
+ "setenv mmcdev 0; " \
|
||||
+ "echo Checking mmc dev ${mmcdev} (microSD card);" \
|
||||
+ "mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan && run loadbootenv; then " \
|
||||
"else " \
|
||||
- "run bootcmd_mmc; " \
|
||||
- "fi"
|
||||
+ "setenv mmcdev 1; " \
|
||||
+ "echo Checking mmc dev ${mmcdev} (SD card);" \
|
||||
+ "mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan && run loadbootenv; then " \
|
||||
+ "else " \
|
||||
+ "setenv mmcdev 2; " \
|
||||
+ "echo Checking mmc dev ${mmcdev} (internal eMMC);" \
|
||||
+ "mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan && run loadbootenv; then " \
|
||||
+ "else " \
|
||||
+ "echo No SD/MMC with uEnv.txt found on device 0 to 2;" \
|
||||
+ "setenv mmcdev ${mmcdevold}; " \
|
||||
+ "fi; " \
|
||||
+ "fi; " \
|
||||
+ "fi; " \
|
||||
+ "setenv mmcdevold; " \
|
||||
+ "echo; " \
|
||||
+ "echo Using SD/MMC device ${mmcdev};" \
|
||||
+ "mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan; then " \
|
||||
+ "echo SD/MMC found on device ${mmcdev};" \
|
||||
+ "if run loadbootenv; then " \
|
||||
+ "run importbootenv;" \
|
||||
+ "fi;" \
|
||||
+ "echo Checking if uenvcmd is set ...;" \
|
||||
+ "if test -n $uenvcmd; then " \
|
||||
+ "echo Running uenvcmd ...;" \
|
||||
+ "run uenvcmd;" \
|
||||
+ "fi;" \
|
||||
+ "echo Running default loadzimage ...;" \
|
||||
+ "if run loadzimage; then " \
|
||||
+ "run mmcboot;" \
|
||||
+ "fi;" \
|
||||
+ "fi;"
|
||||
|
||||
#endif /* __TBS2910_CONFIG_H * */
|
@ -1,167 +0,0 @@
|
||||
diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c
|
||||
index f24d21e..a28c9e0 100644
|
||||
--- a/board/udoo/udoo_spl.c
|
||||
+++ b/board/udoo/udoo_spl.c
|
||||
@@ -216,7 +216,7 @@ static void gpr_init(void)
|
||||
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
|
||||
|
||||
/* enable AXI cache for VDOA/VPU/IPU */
|
||||
- writel(0xF00000FF, &iomux->gpr[4]);
|
||||
+ writel(0xF00000CF, &iomux->gpr[4]);
|
||||
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
|
||||
writel(0x007F007F, &iomux->gpr[6]);
|
||||
writel(0x007F007F, &iomux->gpr[7]);
|
||||
diff --git a/include/configs/udoo.h b/include/configs/udoo.h
|
||||
index 0a7767c..6d8cb08 100644
|
||||
--- a/include/configs/udoo.h
|
||||
+++ b/include/configs/udoo.h
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
#include "mx6_common.h"
|
||||
|
||||
+/*#define CONFIG_SPL_MMC_SUPPORT*/
|
||||
+#define CONFIG_SPL_FAT_SUPPORT
|
||||
+
|
||||
#include "imx6_spl.h"
|
||||
|
||||
#define MACH_TYPE_UDOO 4800
|
||||
@@ -25,6 +28,35 @@
|
||||
#define CONFIG_MXC_UART
|
||||
#define CONFIG_MXC_UART_BASE UART2_BASE
|
||||
|
||||
+/* USB and USB Mass Storage support */
|
||||
+
|
||||
+#define CONFIG_CMD_USB
|
||||
+/*#define CONFIG_CMD_FAT*/
|
||||
+#define CONFIG_USB_EHCI
|
||||
+#define CONFIG_USB_EHCI_MX6
|
||||
+#define CONFIG_USB_STORAGE
|
||||
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
|
||||
+#define CONFIG_USB_HOST_ETHER
|
||||
+#define CONFIG_USB_ETHER_ASIX
|
||||
+#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
|
||||
+#define CONFIG_MXC_USB_FLAGS 0
|
||||
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
|
||||
+#define CONFIG_USB_KEYBOARD
|
||||
+
|
||||
+#define CONFIG_CI_UDC
|
||||
+#define CONFIG_USBD_HS
|
||||
+#define CONFIG_USB_GADGET_DUALSPEED
|
||||
+
|
||||
+#define CONFIG_USB_GADGET
|
||||
+#define CONFIG_CMD_USB_MASS_STORAGE
|
||||
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
|
||||
+#define CONFIG_USB_GADGET_DOWNLOAD
|
||||
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
|
||||
+
|
||||
+#define CONFIG_G_DNL_VENDOR_NUM 0x0525
|
||||
+#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
|
||||
+#define CONFIG_G_DNL_MANUFACTURER "Udoo"
|
||||
+
|
||||
/* SATA Configs */
|
||||
|
||||
#define CONFIG_CMD_SATA
|
||||
@@ -58,11 +90,15 @@
|
||||
/* MMC Configuration */
|
||||
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
|
||||
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 1
|
||||
+
|
||||
#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
+ "zImage=KERNEL\0" \
|
||||
"script=boot.scr\0" \
|
||||
- "image=zImage\0" \
|
||||
+ "image=${zImage}\0" \
|
||||
"console=ttymxc1\0" \
|
||||
"splashpos=m,m\0" \
|
||||
"fdt_high=0xffffffff\0" \
|
||||
@@ -71,9 +107,12 @@
|
||||
"fdt_addr=0x18000000\0" \
|
||||
"boot_fdt=try\0" \
|
||||
"ip_dyn=yes\0" \
|
||||
+ "optargs=\0" \
|
||||
+ "video=\0" \
|
||||
"mmcdev=0\0" \
|
||||
"mmcpart=1\0" \
|
||||
- "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
|
||||
+ "mmcroot=/dev/mmcblk0p2 ro\0" \
|
||||
+ "mmcrootfstype=ext4 rootwait\0" \
|
||||
"update_sd_firmware_filename=u-boot.imx\0" \
|
||||
"update_sd_firmware=" \
|
||||
"if test ${ip_dyn} = yes; then " \
|
||||
@@ -89,27 +128,36 @@
|
||||
"fi; " \
|
||||
"fi\0" \
|
||||
"mmcargs=setenv bootargs console=${console},${baudrate} " \
|
||||
- "root=${mmcroot}\0" \
|
||||
+ "${optargs} " \
|
||||
+ "root=${mmcroot} " \
|
||||
+ "rootfstype=${mmcrootfstype} " \
|
||||
+ "video=${video}\0" \
|
||||
+ "loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \
|
||||
+ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
|
||||
+ "env import -t $loadaddr $filesize\0" \
|
||||
"loadbootscript=" \
|
||||
- "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
+ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
"bootscript=echo Running bootscript from mmc ...; " \
|
||||
"source\0" \
|
||||
- "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
|
||||
+ "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${zImage}\0" \
|
||||
+ "loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${zImage}\0" \
|
||||
"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
"mmcboot=echo Booting from mmc ...; " \
|
||||
"run mmcargs; " \
|
||||
+ "bootz ${loadaddr} - ${fdt_addr};\0" \
|
||||
+ "mmcbootdefault=echo Booting from mmc ...; " \
|
||||
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||
"if run loadfdt; then " \
|
||||
"bootz ${loadaddr} - ${fdt_addr}; " \
|
||||
"else " \
|
||||
"if test ${boot_fdt} = try; then " \
|
||||
- "bootz; " \
|
||||
+ "bootz ${loadaddr}; " \
|
||||
"else " \
|
||||
"echo WARN: Cannot load the DT; " \
|
||||
"fi; " \
|
||||
"fi; " \
|
||||
"else " \
|
||||
- "bootz; " \
|
||||
+ "bootz ${loadaddr}; " \
|
||||
"fi;\0" \
|
||||
"netargs=setenv bootargs console=${console},${baudrate} " \
|
||||
"root=/dev/nfs " \
|
||||
@@ -145,16 +193,23 @@
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"run findfdt; " \
|
||||
- "mmc dev ${mmcdev}; if mmc rescan; then " \
|
||||
- "if run loadbootscript; then " \
|
||||
- "run bootscript; " \
|
||||
- "else " \
|
||||
+ "mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan; then " \
|
||||
+ "echo SD/MMC found on device ${mmcdev};" \
|
||||
+ "if run loadbootenv; then " \
|
||||
+ "run importbootenv;" \
|
||||
+ "fi;" \
|
||||
+ "echo Checking if uenvcmd is set ...;" \
|
||||
+ "if test -n $uenvcmd; then " \
|
||||
+ "echo Running uenvcmd ...;" \
|
||||
+ "run uenvcmd;" \
|
||||
+ "fi;" \
|
||||
+ "echo Running default loadimage ...;" \
|
||||
"if run loadimage; then " \
|
||||
+ "run loadfdt;" \
|
||||
"run mmcboot; " \
|
||||
- "else run netboot; " \
|
||||
- "fi; " \
|
||||
"fi; " \
|
||||
- "else run netboot; fi"
|
||||
+ "fi;"
|
||||
|
||||
/* Print Buffer Size */
|
||||
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
|
@ -18,105 +18,47 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="u-boot"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
|
||||
PKG_COMMIT="ad02f49"
|
||||
PKG_VERSION="imx6-$PKG_COMMIT"
|
||||
PKG_SHA256="bee9c8f4d21230a53605ed0df2ee79a9d2a18a49870d235ec0993a26a37ba0fd"
|
||||
PKG_SITE="http://solid-run.com/wiki/doku.php?id=products:imx6:software:development:u-boot"
|
||||
PKG_URL="https://github.com/SolidRun/u-boot-imx6/archive/$PKG_COMMIT.tar.gz"
|
||||
PKG_SOURCE_NAME="$PKG_NAME-sr-$PKG_VERSION.tar.gz"
|
||||
PKG_SOURCE_DIR="$PKG_NAME-imx6-${PKG_COMMIT}*"
|
||||
[ -n "$UBOOT_CONFIG_V2" ] && PKG_DEPENDS_TARGET="toolchain u-boot-v2"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
PKG_VERSION="2017.09"
|
||||
PKG_SHA256="b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744"
|
||||
PKG_ARCH="arm aarch64"
|
||||
PKG_SITE="https://www.denx.de/wiki/U-Boot"
|
||||
PKG_URL="ftp://ftp.denx.de/pub/u-boot/u-boot-$PKG_VERSION.tar.bz2"
|
||||
PKG_SOURCE_DIR="u-boot-$PKG_VERSION"
|
||||
PKG_DEPENDS_TARGET="toolchain dtc:host"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SECTION="tools"
|
||||
PKG_SHORTDESC="u-boot: Universal Bootloader project"
|
||||
PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems, used as the default boot loader by several board vendors. It is intended to be easy to port and to debug, and runs on many supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS, and Microblaze."
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
pre_configure_target() {
|
||||
if [ -z "$UBOOT_CONFIG" ]; then
|
||||
echo "$TARGET_PLATFORM does not define any u-boot configuration, aborting."
|
||||
echo "Please add UBOOT_CONFIG to your project options file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$UBOOT_CONFIGFILE" ]; then
|
||||
UBOOT_CONFIGFILE="boot.scr"
|
||||
fi
|
||||
|
||||
unset LDFLAGS
|
||||
|
||||
# dont build in parallel because of problems
|
||||
MAKEFLAGS=-j1
|
||||
|
||||
# copy compiler-gcc5.h to compiler-gcc6. for fake building
|
||||
cp include/linux/compiler-gcc5.h include/linux/compiler-gcc6.h
|
||||
}
|
||||
PKG_IS_KERNEL_PKG="yes"
|
||||
|
||||
make_target() {
|
||||
# get number of targets to build
|
||||
UBOOT_TARGET_CNT=0
|
||||
for UBOOT_TARGET in $UBOOT_CONFIG; do
|
||||
UBOOT_TARGET_CNT=$((UBOOT_TARGET_CNT + 1))
|
||||
done
|
||||
|
||||
for UBOOT_TARGET in $UBOOT_CONFIG; do
|
||||
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"
|
||||
|
||||
# rename files in case of multiple targets
|
||||
if [ $UBOOT_TARGET_CNT -gt 1 ]; then
|
||||
if [ "$UBOOT_TARGET" = "mx6_cubox-i_config" ]; then
|
||||
TARGET_NAME="cuboxi"
|
||||
elif [ "$UBOOT_TARGET" = "matrix" ]; then
|
||||
TARGET_NAME="matrix"
|
||||
elif [ "$UBOOT_TARGET" = "udoo_config" ]; then
|
||||
TARGET_NAME="udoo"
|
||||
if [ -z "$UBOOT_SYSTEM" ]; then
|
||||
echo "UBOOT_SYSTEM must be set to build an image"
|
||||
echo "see './scripts/uboot_helper' for more information"
|
||||
else
|
||||
TARGET_NAME="undef"
|
||||
CROSS_COMPILE="$TARGET_PREFIX" LDFLAGS="" ARCH=arm make mrproper
|
||||
CROSS_COMPILE="$TARGET_PREFIX" LDFLAGS="" ARCH=arm make $($ROOT/$SCRIPTS/uboot_helper $PROJECT $DEVICE $UBOOT_SYSTEM config)
|
||||
CROSS_COMPILE="$TARGET_PREFIX" LDFLAGS="" ARCH=arm make HOSTCC="$HOST_CC" HOSTSTRIP="true"
|
||||
fi
|
||||
|
||||
[ -f u-boot.img ] && mv u-boot.img u-boot-$TARGET_NAME.img || :
|
||||
[ -f u-boot.imx ] && mv u-boot.imx u-boot-$TARGET_NAME.imx || :
|
||||
[ -f SPL ] && mv SPL SPL-$TARGET_NAME || :
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $TOOLCHAIN/bin
|
||||
if [ -f build/tools/mkimage ]; then
|
||||
cp build/tools/mkimage $TOOLCHAIN/bin
|
||||
else
|
||||
cp tools/mkimage $TOOLCHAIN/bin
|
||||
fi
|
||||
|
||||
BOOT_CFG="$PROJECT_DIR/$PROJECT/bootloader/boot.cfg"
|
||||
if [ -r "$BOOT_CFG" ]; then
|
||||
cp $BOOT_CFG boot.cfg
|
||||
mkimage -A "$TARGET_ARCH" \
|
||||
-O u-boot \
|
||||
-T script \
|
||||
-C none \
|
||||
-n "$DISTRONAME Boot" \
|
||||
-d boot.cfg \
|
||||
$UBOOT_CONFIGFILE
|
||||
fi
|
||||
|
||||
mkdir -p $INSTALL/usr/share/bootloader
|
||||
|
||||
cp $PKG_BUILD/u-boot*.imx $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp $PKG_BUILD/u-boot*.img $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
cp $PKG_BUILD/SPL* $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
cp $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 || :
|
||||
# Only install u-boot.img et al when building a board specific image
|
||||
if [ -n "$UBOOT_SYSTEM" ]; then
|
||||
if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/install ]; then
|
||||
. $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/install
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/bootloader/install ]; then
|
||||
. $PROJECT_DIR/$PROJECT/bootloader/install
|
||||
fi
|
||||
fi
|
||||
|
||||
# Always install the update script
|
||||
if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/update.sh ]; then
|
||||
cp -av $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/update.sh $INSTALL/usr/share/bootloader
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/bootloader/update.sh ]; then
|
||||
cp -av $PROJECT_DIR/$PROJECT/bootloader/update.sh $INSTALL/usr/share/bootloader
|
||||
fi
|
||||
}
|
||||
|
38
packages/tools/u-boot/patches/2017.09/u-boot-0001-dont-build-libfdt.patch
vendored
Normal file
38
packages/tools/u-boot/patches/2017.09/u-boot-0001-dont-build-libfdt.patch
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
diff -Naur a/Makefile b/Makefile
|
||||
--- a/Makefile 2017-09-11 11:10:40.000000000 -0700
|
||||
+++ b/Makefile 2017-10-03 13:41:57.992106628 -0700
|
||||
@@ -1379,7 +1379,7 @@
|
||||
$(call filechk,timestamp.h)
|
||||
|
||||
checkbinman: tools
|
||||
- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools $(PYTHON) )); then \
|
||||
+ @if ! ( echo 'from pylibfdt import libfdt' | ( python )); then \
|
||||
echo >&2; \
|
||||
echo >&2 '*** binman needs the Python libfdt library.'; \
|
||||
echo >&2 '*** Either install it on your system, or try:'; \
|
||||
diff -Naur a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
|
||||
--- a/tools/dtoc/fdt.py 2017-09-11 11:10:40.000000000 -0700
|
||||
+++ b/tools/dtoc/fdt.py 2017-10-03 13:42:18.398306028 -0700
|
||||
@@ -10,7 +10,7 @@
|
||||
import sys
|
||||
|
||||
import fdt_util
|
||||
-import libfdt
|
||||
+from pylibfdt import libfdt
|
||||
|
||||
# This deals with a device tree, presenting it as an assortment of Node and
|
||||
# Prop objects, representing nodes and properties, respectively. This file
|
||||
diff -Naur a/tools/Makefile b/tools/Makefile
|
||||
--- a/tools/Makefile 2017-09-11 11:10:40.000000000 -0700
|
||||
+++ b/tools/Makefile 2017-10-03 13:42:33.286451519 -0700
|
||||
@@ -232,10 +232,6 @@
|
||||
|
||||
always := $(hostprogs-y)
|
||||
|
||||
-# Build a libfdt Python module if swig is available
|
||||
-# Use 'sudo apt-get install swig libpython-dev' to enable this
|
||||
-always += $(if $(shell which swig 2> /dev/null),_libfdt.so)
|
||||
-
|
||||
# Generated LCD/video logo
|
||||
LOGO_H = $(objtree)/include/bmp_logo.h
|
||||
LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
|
@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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.
|
||||
#
|
||||
# OpenELEC 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 OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
if [ -z "$UBOOT_CONFIGFILE" ]; then
|
||||
UBOOT_CONFIGFILE="boot.scr"
|
||||
fi
|
||||
|
||||
mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||
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 || :
|
||||
|
||||
cp -PR $PROJECT_DIR/$PROJECT/bootloader/uEnv*.txt $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 || :
|
@ -1,98 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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.
|
||||
#
|
||||
# OpenELEC 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 OpenELEC. 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
|
||||
|
||||
SYSTEM_TYPE=""
|
||||
if [ -f $SYSTEM_ROOT/usr/lib/libreelec/imx6-system-type ]; then
|
||||
. $SYSTEM_ROOT/usr/lib/libreelec/imx6-system-type
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/w
|
||||
mount -o remount,rw $BOOT_ROOT
|
||||
|
||||
# update Device Tree Blobs
|
||||
for all_dtb in /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
|
||||
|
||||
# update bootloader files
|
||||
if [ "$SYSTEM_TYPE" = "matrix" ]; then
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot-$SYSTEM_TYPE.imx ]; then
|
||||
echo "*** updating u-boot image in eMMC ..."
|
||||
# clean up u-boot parameters
|
||||
#dd if=/dev/zero of=/dev/mmcblk0 bs=1024 seek=384 count=8
|
||||
# access boot partition 1
|
||||
echo 0 > /sys/block/mmcblk0boot0/force_ro
|
||||
# write u-boot to eMMC
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot-$SYSTEM_TYPE.imx of=/dev/mmcblk0boot0 bs=1k seek=1 conv=fsync &>/dev/null
|
||||
# re-enable read-only access
|
||||
echo 1 > /sys/block/mmcblk0boot0/force_ro
|
||||
# enable boot partion 1 to boot
|
||||
echo 8 > /sys/devices/soc0/soc.1/2100000.aips-bus/219c000.usdhc/mmc_host/mmc2/mmc2:0001/boot_config
|
||||
fi
|
||||
else
|
||||
if [ -n "$SYSTEM_TYPE" ]; then
|
||||
UBOOT_IMG_SRC=u-boot-$SYSTEM_TYPE.img
|
||||
SPL_SRC=SPL-$SYSTEM_TYPE
|
||||
else
|
||||
UBOOT_IMG_SRC=u-boot.img
|
||||
SPL_SRC=SPL
|
||||
fi
|
||||
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$UBOOT_IMG_SRC ]; then
|
||||
echo "*** updating u-boot image: $BOOT_ROOT/u-boot.img ..."
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/$UBOOT_IMG_SRC $BOOT_ROOT/u-boot.img
|
||||
fi
|
||||
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$SPL_SRC ]; then
|
||||
echo "*** updating u-boot SPL Blob on: $BOOT_DISK ..."
|
||||
dd if="$SYSTEM_ROOT/usr/share/bootloader/$SPL_SRC" of="$BOOT_DISK" bs=1k seek=1 conv=fsync &>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
# prefer uEnv.txt over boot.scr
|
||||
if [ -n "$SYSTEM_TYPE" -a -f $SYSTEM_ROOT/usr/share/bootloader/uEnv-$SYSTEM_TYPE.txt -a ! -f $BOOT_ROOT/uEnv.txt ]; then
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/uEnv-$SYSTEM_TYPE.txt $BOOT_ROOT/uEnv.txt
|
||||
elif [ -f $SYSTEM_ROOT/usr/share/bootloader/uEnv.txt -a ! -f $BOOT_ROOT/uEnv.txt ]; then
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/uEnv.txt $BOOT_ROOT
|
||||
elif [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.scr -a ! -f $BOOT_ROOT/boot.scr ]; then
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/boot.scr $BOOT_ROOT
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/o
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
32
projects/Odroid_C2/bootloader/mkimage
Normal file
32
projects/Odroid_C2/bootloader/mkimage
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
# 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/>.
|
||||
################################################################################
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot.bin" ]; then
|
||||
echo "Writing u-boot to $(basename $DISK)"
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.bin" of="$DISK" conv=fsync,notrunc bs=1 count=112 >"$SAVE_ERROR" 2>&1 || show_error
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.bin" of="$DISK" conv=fsync,notrunc bs=512 skip=1 seek=1 >"$SAVE_ERROR" 2>&1 || show_error
|
||||
fi
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/boot.ini ::
|
||||
fi
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/meson64_odroidc2.dtb" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/meson64_odroidc2.dtb ::
|
||||
fi
|
@ -21,11 +21,6 @@
|
||||
. config/options $1
|
||||
|
||||
mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -PR $BUILD/linux-*/arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || :
|
||||
cp -PR $BUILD/$BOOTLOADER-*/u-boot.bin $RELEASE_DIR/3rdparty/bootloader/u-boot
|
||||
cp -PR $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader
|
||||
if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then
|
||||
cp -PR $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader
|
||||
elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then
|
||||
cp -PR $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader
|
||||
fi
|
||||
cp -a $(get_build_dir linux)/arch/$TARGET_KERNEL_ARCH/boot/dts/meson64_odroidc2.dtb $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -a $(get_build_dir $BOOTLOADER)/u-boot.bin $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -a $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader
|
||||
|
24
projects/Odroid_C2/packages/u-boot/scripts/update-c2.sh → projects/Odroid_C2/bootloader/update.sh
Normal file → Executable file
24
projects/Odroid_C2/packages/u-boot/scripts/update-c2.sh → projects/Odroid_C2/bootloader/update.sh
Normal file → Executable file
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - https://libreelec.tv
|
||||
# Copyright (C) 2016-present Team LibreELEC
|
||||
@ -36,7 +35,7 @@ fi
|
||||
mount -o remount,rw $BOOT_ROOT
|
||||
|
||||
# update Device Tree Blobs
|
||||
for all_dtb in /flash/*.dtb /flash/DTB; do
|
||||
for all_dtb in /flash/*.dtb; do
|
||||
dtb=$(basename $all_dtb)
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
|
||||
echo "*** updating Device Tree Blob: $dtb ..."
|
||||
@ -44,21 +43,12 @@ fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot-logo.bmp.gz ]; then
|
||||
echo "*** updating boot logo ..."
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/boot-logo.bmp.gz $BOOT_ROOT
|
||||
fi
|
||||
|
||||
echo "*** updating u-boot for Odroid on: $BOOT_DISK ..."
|
||||
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=1 count=112
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=512 skip=1 seek=1
|
||||
|
||||
# monkey patch boot.ini for updated kernel
|
||||
sed -i 's|setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}"|setenv odroidp1 "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs"|' /flash/boot.ini
|
||||
sed -i 's|setenv odroidp2 "${disableuhs} consoleblank=0|setenv odroidp2 "mac=${ethaddr} consoleblank=0|' /flash/boot.ini
|
||||
sed -i 's|setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"|setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"|' /flash/boot.ini
|
||||
sed -i 's|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${hpd} ${dac} ${libreelec}"|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${libreelec}"|' /flash/boot.ini
|
||||
# update bootloader files
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.bin ]; then
|
||||
echo "*** updating u-boot image ..."
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.bin of="$BOOT_DISK" conv=fsync,notrunc bs=1 count=112 &>/dev/null
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.bin of="$BOOT_DISK" conv=fsync,notrunc bs=512 skip=1 seek=1 &>/dev/null
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/o
|
||||
sync
|
@ -53,18 +53,8 @@ make_target() {
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $TOOLCHAIN/bin
|
||||
cp build/tools/mkimage $TOOLCHAIN/bin
|
||||
|
||||
mkdir -p $INSTALL/usr/share/bootloader
|
||||
|
||||
cp $PKG_BUILD/$UBOOT_CONFIGFILE $INSTALL/usr/share/bootloader 2>/dev/null || :
|
||||
|
||||
cp -PRv $PKG_DIR/scripts/update-c2.sh $INSTALL/usr/share/bootloader/update.sh
|
||||
cp -PRv $PKG_BUILD/u-boot.bin $INSTALL/usr/share/bootloader/u-boot
|
||||
if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then
|
||||
cp -PRv $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader
|
||||
elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then
|
||||
cp -PRv $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader
|
||||
fi
|
||||
cp $PROJECT_DIR/$PROJECT/bootloader/boot.ini $INSTALL/usr/share/bootloader
|
||||
cp -av $PKG_BUILD/u-boot.bin $INSTALL/usr/share/bootloader
|
||||
cp -av $PROJECT_DIR/$PROJECT/bootloader/update.sh $INSTALL/usr/share/bootloader
|
||||
}
|
||||
|
@ -65,6 +65,10 @@ if [ -f $STAMP ] ; then
|
||||
if [ ! "$PKG_DEEPMD5" = "$STAMP_PKG_DEEPMD5" ] ; then
|
||||
rm -f $STAMP
|
||||
fi
|
||||
|
||||
if [ "$1" = "u-boot" -a ! "$UBOOT_SYSTEM" = "$STAMP_UBOOT_SYSTEM" ]; then
|
||||
rm -f $STAMP
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $STAMP ]; then
|
||||
@ -478,4 +482,8 @@ if [ ! -f $STAMP ]; then
|
||||
for i in PKG_NAME PKG_DEEPMD5; do
|
||||
echo "STAMP_$i=\"${!i}\"" >> $STAMP
|
||||
done
|
||||
|
||||
if [ "$1" = "u-boot" ]; then
|
||||
echo "STAMP_UBOOT_SYSTEM=\"${UBOOT_SYSTEM}\"" >> $STAMP
|
||||
fi
|
||||
fi
|
||||
|
@ -75,8 +75,8 @@ if [ "$DEVEL_VERSION" = "devel" ] ; then
|
||||
IMAGE_NAME="$DISTRONAME-$LIBREELEC_ARCH-$OS_VERSION-$LIBREELEC_VERSION"
|
||||
fi
|
||||
|
||||
if [ "$PROJECT" == "imx6" -a -n "$SYSTEM" ]; then
|
||||
IMAGE_NAME="$IMAGE_NAME-$SYSTEM"
|
||||
if [ -n "$UBOOT_SYSTEM" ]; then
|
||||
IMAGE_NAME="$IMAGE_NAME-$UBOOT_SYSTEM"
|
||||
fi
|
||||
|
||||
if [ -n "$CUSTOM_IMAGE_NAME" ]; then
|
||||
@ -267,31 +267,17 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]
|
||||
|
||||
# remove n previous created release image
|
||||
rm -rf $TARGET_IMG/$IMAGE_NAME.img.gz
|
||||
if [ -n "$BOOTLOADER" ]; then
|
||||
|
||||
BOOTLOADER_DIR="$(get_pkg_directory "$BOOTLOADER")"
|
||||
|
||||
if [ -d $BOOTLOADER_DIR/files ]; then
|
||||
cp -R $BOOTLOADER_DIR/files/* $RELEASE_DIR
|
||||
fi
|
||||
|
||||
if [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/release ]; then
|
||||
if [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/release ]; then
|
||||
echo "Running $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/release"
|
||||
. $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/release
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/bootloader/release ]; then
|
||||
echo "Running $PROJECT_DIR/$PROJECT/bootloader/release"
|
||||
. $PROJECT_DIR/$PROJECT/bootloader/release
|
||||
elif [ -f $BOOTLOADER_DIR/release ]; then
|
||||
. $BOOTLOADER_DIR/release
|
||||
fi
|
||||
fi
|
||||
|
||||
# MfgTool2 for TBS Matrix support (add it to .tar)
|
||||
# only for matrix system or all? (one tar for all updates?)
|
||||
if [ "$PROJECT" == "imx6" -a "$SYSTEM" == "matrix" ]; then
|
||||
$SCRIPTS/unpack imx6-mfgtool2-tbs-matrix
|
||||
mkdir -p $RELEASE_DIR/MfgTool2-TBS-Matrix
|
||||
cp -PR $BUILD/imx6-mfgtool2-tbs-matrix-*/* $RELEASE_DIR/MfgTool2-TBS-Matrix
|
||||
fi
|
||||
|
||||
cp $ROOT/README* $RELEASE_DIR
|
||||
cp $ROOT/CHANGELOG* $RELEASE_DIR
|
||||
echo "$TARGET_VERSION" > $RELEASE_DIR/RELEASE
|
||||
@ -329,19 +315,11 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]
|
||||
KERNEL_NAME="KERNEL"
|
||||
fi
|
||||
|
||||
UBOOT_SYSTEM=""
|
||||
if [ "$PROJECT" == "imx6" ]; then
|
||||
if [ -n "$SYSTEM" ]; then
|
||||
UBOOT_SYSTEM="$SYSTEM"
|
||||
else
|
||||
UBOOT_SYSTEM="cuboxi"
|
||||
fi
|
||||
fi
|
||||
|
||||
# variables used in image script must be passed
|
||||
env \
|
||||
PATH="$PATH:/sbin" \
|
||||
ROOT="$ROOT" \
|
||||
SCRIPTS="$SCRIPTS" \
|
||||
TOOLCHAIN="$TOOLCHAIN" \
|
||||
PROJECT_DIR="$PROJECT_DIR" \
|
||||
PROJECT="$PROJECT" \
|
||||
|
@ -225,34 +225,35 @@ EOF
|
||||
mcopy -s $RELEASE_DIR/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
|
||||
elif [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
elif [ "$BOOTLOADER" = "u-boot" -a \( -n "$UBOOT_SYSTEM" -o "$PROJECT" = "Odroid_C2" \) ]; then
|
||||
# create bootloader configuration
|
||||
echo "image: creating bootloader configuration..."
|
||||
if [ -n "$UBOOT_SYSTEM" -a -f "$RELEASE_DIR/3rdparty/bootloader/uEnv-$UBOOT_SYSTEM.txt" ]; then
|
||||
mcopy "$RELEASE_DIR/3rdparty/bootloader/uEnv-$UBOOT_SYSTEM.txt" ::/uEnv.txt
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/uEnv.txt" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/uEnv.txt ::
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.scr" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/boot.scr ::
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/boot.ini ::
|
||||
|
||||
if [ "$PROJECT" != "Odroid_C2" ]; then
|
||||
DTB="$($SCRIPTS/uboot_helper $PROJECT $DEVICE $UBOOT_SYSTEM dtb)"
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/$DTB" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/$DTB ::
|
||||
fi
|
||||
|
||||
echo "image: installing u-boot bootloader..."
|
||||
if [ -n "$UBOOT_SYSTEM" -a -f "$RELEASE_DIR/3rdparty/bootloader/SPL-$UBOOT_SYSTEM" ]; then
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/SPL-$UBOOT_SYSTEM" of="$DISK" bs=512 seek=2 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/SPL" ]; then
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/SPL" of="$DISK" bs=512 seek=2 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
elif [ -n "$UBOOT_SYSTEM" -a -f "$RELEASE_DIR/3rdparty/bootloader/u-boot-$UBOOT_SYSTEM.imx" ]; then
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot-$UBOOT_SYSTEM.imx" of="$DISK" bs=512 seek=2 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot.imx" ]; then
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.imx" of="$DISK" bs=512 seek=2 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot-fuse" ]; then
|
||||
# allow custom dd script for vendor specific fusing
|
||||
. $RELEASE_DIR/3rdparty/bootloader/u-boot-fuse
|
||||
elif [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot" ]; then
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot" of="$DISK" conv=fsync,notrunc bs=1 count=112 >"$SAVE_ERROR" 2>&1 || show_error
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot" of="$DISK" conv=fsync,notrunc bs=512 skip=1 seek=1 >"$SAVE_ERROR" 2>&1 || show_error
|
||||
mkdir -p "$LE_TMP"/extlinux
|
||||
|
||||
cat << EOF > "$LE_TMP"/extlinux/extlinux.conf
|
||||
LABEL $DISTRO
|
||||
LINUX /$KERNEL_NAME
|
||||
FDT /$DTB
|
||||
APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE quiet $EXTRA_CMDLINE
|
||||
EOF
|
||||
|
||||
mcopy -s "$LE_TMP"/extlinux ::
|
||||
fi
|
||||
|
||||
if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/mkimage ]; then
|
||||
. $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/mkimage
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/bootloader/mkimage ]; then
|
||||
. $PROJECT_DIR/$PROJECT/bootloader/mkimage
|
||||
else
|
||||
echo "No specific mkimage script found. u-boot will not be written"
|
||||
fi
|
||||
|
||||
echo "image: copying files to part1..."
|
||||
@ -261,26 +262,9 @@ elif [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
mcopy $RELEASE_DIR/target/KERNEL.md5 "::/$KERNEL_NAME.md5"
|
||||
mcopy $RELEASE_DIR/target/SYSTEM.md5 ::/SYSTEM.md5
|
||||
|
||||
if [ -n "$UBOOT_SYSTEM" -a -f "$RELEASE_DIR/3rdparty/bootloader/u-boot-$UBOOT_SYSTEM.img" ]; then
|
||||
mcopy "$RELEASE_DIR/3rdparty/bootloader/u-boot-$UBOOT_SYSTEM.img" ::/u-boot.img
|
||||
elif [ -f $RELEASE_DIR/3rdparty/bootloader/u-boot.img ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/u-boot.img ::
|
||||
fi
|
||||
|
||||
if [ -f $RELEASE_DIR/3rdparty/bootloader/boot-logo.bmp.gz ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/boot-logo.bmp.gz ::
|
||||
fi
|
||||
|
||||
for dtb in $RELEASE_DIR/3rdparty/bootloader/*.dtb ; do
|
||||
if [ -f $dtb ] ; then
|
||||
mcopy "$dtb" ::/$(basename "$dtb")
|
||||
fi
|
||||
done
|
||||
|
||||
# copy Amlogic device tree image
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/dtb.img" ]; then
|
||||
mcopy $RELEASE_DIR/3rdparty/bootloader/dtb.img ::
|
||||
fi
|
||||
elif [ "$BOOTLOADER" = "u-boot" ]; then
|
||||
echo "to make an image using u-boot UBOOT_SYSTEM must be set"
|
||||
cleanup
|
||||
fi # bootloader
|
||||
|
||||
# extract part2 from image to format and copy files
|
||||
|
67
scripts/uboot_helper
Executable file
67
scripts/uboot_helper
Executable file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
devices = {
|
||||
'project' : {
|
||||
'device' : {
|
||||
'board_name' : { 'dtb' : 'board_name.dtb', 'config' : 'board_name_defconfig' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def usage():
|
||||
print(' '.join(['Usage:', sys.argv[0], '<project>', '<soc>', '<board-name>', 'dtb|config']))
|
||||
print(' '.join([' ', sys.argv[0], '<project>', '<soc>']))
|
||||
print(' '.join([' ', sys.argv[0], '<project>']) + '\n')
|
||||
print('Projects:' + '\n')
|
||||
for project in devices:
|
||||
print(' ' + project + ':')
|
||||
for soc in devices[project]:
|
||||
print(' ' + soc + ':')
|
||||
for board in devices[project][soc]:
|
||||
print(' ' + board)
|
||||
print('')
|
||||
print('')
|
||||
|
||||
# Get dtb or u-boot config for a given project, soc, and board
|
||||
# ./scripts/uboot_helper project device board_name dtb
|
||||
if len(sys.argv) == 5:
|
||||
if sys.argv[1] in devices:
|
||||
if sys.argv[2] in devices[sys.argv[1]]:
|
||||
if sys.argv[3] in devices[sys.argv[1]][sys.argv[2]]:
|
||||
if sys.argv[4] in ['dtb', 'config']:
|
||||
print(devices[sys.argv[1]][sys.argv[2]][sys.argv[3]][sys.argv[4]])
|
||||
sys.exit(0)
|
||||
|
||||
# List boards supported by a given project and soc
|
||||
# ./scripts/uboot_helper project device
|
||||
elif len(sys.argv) == 3:
|
||||
if sys.argv[1] in devices:
|
||||
if sys.argv[2] in devices[sys.argv[1]]:
|
||||
boards = []
|
||||
for board in devices[sys.argv[1]][sys.argv[2]]:
|
||||
boards.append(board)
|
||||
print(' '.join(boards))
|
||||
sys.exit(0)
|
||||
|
||||
# List socs supported by a given project
|
||||
# ./scripts/uboot_helper project
|
||||
elif len(sys.argv) == 2:
|
||||
if sys.argv[1] in devices:
|
||||
socs = []
|
||||
for soc in devices[sys.argv[1]]:
|
||||
socs.append(soc)
|
||||
print(' '.join(socs))
|
||||
sys.exit(0)
|
||||
|
||||
# List projects
|
||||
# ./scripts/uboot_helper
|
||||
elif len(sys.argv) == 1:
|
||||
projects = []
|
||||
for project in devices:
|
||||
projects.append(project)
|
||||
print(' '.join(projects))
|
||||
sys.exit(0)
|
||||
|
||||
usage()
|
Loading…
x
Reference in New Issue
Block a user