diff --git a/projects/Amlogic/devices/LePotato/bootloader/boot.ini b/projects/Amlogic/devices/LePotato/bootloader/boot.ini index 3c13ef83d8..b252c86ca7 100644 --- a/projects/Amlogic/devices/LePotato/bootloader/boot.ini +++ b/projects/Amlogic/devices/LePotato/bootloader/boot.ini @@ -1,113 +1,37 @@ #------------------------------------------------------------------------------------------------------ # -# boot.ini identification +# boot.ini +# +# WARNING DO NOT MODIFY THIS FILE! ALL CHANGES WILL BE LOST WITH THE NEXT UPDATE! +# Set your own settings in config.ini # #------------------------------------------------------------------------------------------------------ LIBRETECH-UBOOT-CONFIG -#------------------------------------------------------------------------------------------------------ -# -# Boot Specific Stuff -# -#------------------------------------------------------------------------------------------------------ setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=LIBREELEC disk=LABEL=STORAGE" - -#------------------------------------------------------------------------------------------------------ -# -# Console Setup -# -#------------------------------------------------------------------------------------------------------ -setenv console "console=ttyS0,115200" - -#------------------------------------------------------------------------------------------------------ -# -# Video -# Setup the video output (default is 1080p60hz) -# 480 Lines (720x480) -# setenv hdmimode "480i60hz" # Interlaced 60Hz -# setenv hdmimode "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz -# setenv hdmimode "480p60hz" # 480 Progressive 60Hz -# setenv hdmimode "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz -# 576 Lines (720x576) -# setenv hdmimode "576i50hz" # Interlaced 50Hz -# setenv hdmimode "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz -# setenv hdmimode "576p50hz" # Progressive 50Hz -# setenv hdmimode "576p_rpt" # Progressive for Rear Projection Televisions 50Hz -# 720 Lines (1280x720) -# setenv hdmimode "720p60hz" # Progressive 60Hz -# setenv hdmimode "720p50hz" # Progressive 50Hz -# 1080 Lines (1920x1080) -# setenv hdmimode "1080i60hz" # Interlaced 60Hz -# setenv hdmimode "1080p60hz" # Progressive 60Hz -# setenv hdmimode "1080i50hz" # Interlaced 50Hz -# setenv hdmimode "1080p50hz" # Progressive 50Hz -# setenv hdmimode "1080p30hz" # Progressive 30Hz -# setenv hdmimode "1080p25hz" # Progressive 25Hz -# setenv hdmimode "1080p24hz" # Progressive 24Hz -# 4K (3840x2160) -# setenv hdmimode "2160p60hz" # Progressive 60Hz -# setenv hdmimode "2160p50hz" # Progressive 50Hz -# setenv hdmimode "2160p30hz" # Progressive 30Hz -# setenv hdmimode "2160p25hz" # Progressive 25Hz -# setenv hdmimode "2160p24hz" # Progressive 24Hz -# setenv hdmimode "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# setenv hdmimode "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# 4K2K (4096x2160) -# setenv hdmimode "smpte60hz" # Progressive 60Hz SMPTE -# setenv hdmimode "smpte50hz" # Progressive 50Hz SMPTE -# setenv hdmimode "smpte30hz" # Progressive 30Hz SMPTE -# setenv hdmimode "smpte25hz" # Progressive 25Hz SMPTE -# setenv hdmimode "smpte24hz" # Progressive 24Hz SMPTE -# setenv hdmimode "smpte60hz420" # Progressive 60Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# setenv hdmimode "smpte50hz420" # Progressive 50Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# -#------------------------------------------------------------------------------------------------------ +setenv condev "tty0" setenv hdmimode "1080p60hz" - -#------------------------------------------------------------------------------------------------------ -# -# LibreELEC variables -# -# Setup the LibreELEC options -# valid values are: textmode debugging progress nofsck nosplash noram overlay quiet ssh -#------------------------------------------------------------------------------------------------------ -setenv libreelec "" - -#------------------------------------------------------------------------------------------------------ -# -# Amremote -# -#------------------------------------------------------------------------------------------------------ -setenv amremote "0" - -#------------------------------------------------------------------------------------------------------ -# -# Enable|Disable HDMI CEC Control -# setenv hdmi_cec "0" # Disabled -# setenv hdmi_cec "1" # Enabled -# -#------------------------------------------------------------------------------------------------------ +setenv hdmioutput "1" +setenv vpu "1" +setenv libreelec "quiet" setenv hdmi_cec "1" +setenv uenv_addr 0x13000000 + +fatload mmc 0:1 ${loadaddr} kernel.img +fatload mmc 0:1 ${dtb_mem_addr} dtb.img + +if fatload mmc 0:1 ${uenv_addr} config.ini; then env import -t ${uenv_addr} $filesize; fi -#------------------------------------------------------------------------------------------------------ -# -# Board specific -# -#------------------------------------------------------------------------------------------------------ setenv libretech "no_console_suspend logo=osd1,loaded,0x3f800000,${hdmimode} vout=${hdmimode},enable hdmimode=${hdmimode} cvbsmode=nocvbs consoleblank=0" if test "${hdmi_cec}" = "1"; then setenv cec "hdmitx=cec17"; fi -setenv bootargs "${console} ${bootrootfs} ${libretech} ${cec} ${libreelec}" - -# Prepare to boot -fatload mmc 0:1 ${loadaddr} kernel.img +setenv bootargs "console=${condev} ${bootrootfs} ${libretech} ${cec} ${libreelec}" # Device tree modifications -bootm start ${loadaddr} +bootm start bootm loados bootm fdt -if test "${amremote}" = "0"; then fdt set /meson-ir status okay; fdt set /meson-remote status disabled; fi -# Remove Android partitions from device tree -fdt rm /partitions +if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi +if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi bootm prep # Boot the board diff --git a/projects/Amlogic/devices/LePotato/bootloader/config.ini b/projects/Amlogic/devices/LePotato/bootloader/config.ini new file mode 100644 index 0000000000..1dfa45d044 --- /dev/null +++ b/projects/Amlogic/devices/LePotato/bootloader/config.ini @@ -0,0 +1,70 @@ +#------------------------------------------------------------------------------------------------------ +# +# config.ini +# +#------------------------------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------------------------ +# +# Console Setup +# on serial port: +# condev="ttyS0,115200n8" +# +#------------------------------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------------------------ +# +# Video +# Setup the video output +# hdmimode="480i60hz" +# hdmimode="480i_rpt" +# hdmimode="480p60hz" +# hdmimode="480p_rpt" +# hdmimode="576i50hz" +# hdmimode="576i_rpt" +# hdmimode="576p50hz" +# hdmimode="576p_rpt" +# hdmimode="720p60hz" +# hdmimode="720p50hz" +# hdmimode="1080i60hz" +# hdmimode="1080p60hz" +# hdmimode="1080i50hz" +# hdmimode="1080p50hz" +# hdmimode="1080p30hz" +# hdmimode="1080p25hz" +# hdmimode="1080p24hz" +# hdmimode="2160p60hz" +# hdmimode="2160p50hz" +# hdmimode="2160p30hz" +# hdmimode="2160p25hz" +# hdmimode="2160p24hz" +# hdmimode="2160p60hz420" +# hdmimode="2160p50hz420" +# hdmimode="smpte60hz" +# hdmimode="smpte50hz" +# hdmimode="smpte30hz" +# hdmimode="smpte25hz" +# hdmimode="smpte24hz" +# hdmimode="smpte60hz420" +# hdmimode="smpte50hz420" +# +#------------------------------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------------------------ +# +# LibreELEC variables +# +# Setup the LibreELEC options +# valid values are: textmode debugging progress nofsck nosplash noram overlay quiet ssh +# +# libreelec="quiet" +# +#------------------------------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------------------------ +# +# Enable|Disable HDMI CEC Control +# hdmi_cec="0" +# hdmi_cec="1" +# +#------------------------------------------------------------------------------------------------------ diff --git a/projects/Amlogic/devices/LePotato/bootloader/mkimage b/projects/Amlogic/devices/LePotato/bootloader/mkimage index 56446f20bf..fd36183296 100644 --- a/projects/Amlogic/devices/LePotato/bootloader/mkimage +++ b/projects/Amlogic/devices/LePotato/bootloader/mkimage @@ -28,7 +28,6 @@ if [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then mcopy $RELEASE_DIR/3rdparty/bootloader/boot.ini :: fi -# this is done by scripts/mkimage -#if [ -f "$RELEASE_DIR/3rdparty/bootloader/dtb.img" ]; then -# mcopy $RELEASE_DIR/3rdparty/bootloader/dtb.img :: -#fi +if [ -f "$RELEASE_DIR/3rdparty/bootloader/config.ini" ]; then + mcopy $RELEASE_DIR/3rdparty/bootloader/config.ini :: +fi diff --git a/projects/Amlogic/devices/LePotato/bootloader/release b/projects/Amlogic/devices/LePotato/bootloader/release index dd811a4f66..f3b4418ef7 100755 --- a/projects/Amlogic/devices/LePotato/bootloader/release +++ b/projects/Amlogic/devices/LePotato/bootloader/release @@ -24,3 +24,4 @@ mkdir -p $RELEASE_DIR/3rdparty/bootloader cp -a $(get_build_dir linux)/arch/$TARGET_KERNEL_ARCH/boot/dtb.img $RELEASE_DIR/3rdparty/bootloader cp -a $(get_build_dir $BOOTLOADER)/fip/u-boot.bin.sd.bin $RELEASE_DIR/3rdparty/bootloader/u-boot.bin cp -a $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader + cp -a $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/config.ini $RELEASE_DIR/3rdparty/bootloader diff --git a/projects/Amlogic/devices/LePotato/packages/u-boot/package.mk b/projects/Amlogic/devices/LePotato/packages/u-boot/package.mk index 6b111862d1..19282383c9 100644 --- a/projects/Amlogic/devices/LePotato/packages/u-boot/package.mk +++ b/projects/Amlogic/devices/LePotato/packages/u-boot/package.mk @@ -33,6 +33,10 @@ PKG_IS_KERNEL_PKG="yes" PKG_NEED_UNPACK="$PROJECT_DIR/$PROJECT/bootloader" [ -n "$DEVICE" ] && PKG_NEED_UNPACK+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader" +post_unpack() { + sed -i 's/^#define CONFIG_DDR_CLK.*912/#define CONFIG_DDR_CLK 792/g' $PKG_BUILD/board/amlogic/configs/libretech_cc.h +} + make_target() { export PATH=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/:$TOOLCHAIN/lib/gcc-linaro-arm-eabi/bin/:$PATH CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make mrproper @@ -62,4 +66,8 @@ makeinstall_target() { if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/boot.ini ]; then cp -av $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/boot.ini $INSTALL/usr/share/bootloader fi + + if [ -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/config.ini ]; then + cp -av $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/config.ini $INSTALL/usr/share/bootloader + fi } diff --git a/projects/Amlogic/filesystem/usr/lib/libreelec/remote-config b/projects/Amlogic/filesystem/usr/lib/libreelec/remote-config deleted file mode 100755 index 8229361b30..0000000000 --- a/projects/Amlogic/filesystem/usr/lib/libreelec/remote-config +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of LibreELEC - https://libreelec.tv -# Copyright (C) 2017-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 . -################################################################################ - -SOURCEREMOTECONF="" -REMAP="no" - -if [ -f /storage/.config/remote.conf ]; then - SOURCEREMOTECONF="/storage/.config" - REMAP="yes" -elif [ -f /flash/remote.conf ]; then - SOURCEREMOTECONF="/flash" - REMAP="yes" -elif [ -f /etc/amremote/remote.conf -a "$(cat /proc/device-tree/dvbfe/dtv_demod0 2>/dev/null)" = "Avl6211" ]; then - SOURCEREMOTECONF="/etc/amremote" -elif ! grep -q /dev/system /proc/mounts ; then - mount -o rw,remount /flash - mkdir -p /tmp/system - mount -o ro /dev/system /tmp/system - for f in /tmp/system/etc/remote*.conf; do - cp $f /flash - SOURCEREMOTECONF="/flash" - done - for f in /tmp/system/remote*.conf; do - cp $f /flash - SOURCEREMOTECONF="/flash" - done - umount /tmp/system - REMAP="yes" -fi - -if [ -n "$SOURCEREMOTECONF" ]; then - cp $SOURCEREMOTECONF/remote*.conf /tmp - if [ "$REMAP" = "yes" ]; then - sed -i 's/ 15[^0-9]*$/ 1/ - s/ 63[^0-9]*$/ 90/ - s/ 97[^0-9]*$/ 28/ - s/ 102[^0-9]*$/ 172/ - s/ 125[^0-9]*$/ 46/ - s/ 142[^0-9]*$/ 116/ - s/ 143[^0-9]*$/ 116/ - s/ 158[^0-9]*$/ 1/ - s/ 183[^0-9]*$/ 59/ - s/ 184[^0-9]*$/ 399/ - s/ 185[^0-9]*$/ 400/ - s/ 186[^0-9]*$/ 60/ - s/ 232[^0-9]*$/ 28/ - s/ 240[^0-9]*$/ 164/ - s/ 241[^0-9]*$/ 163/ - s/ 242[^0-9]*$/ 165/ - s/ 244[^0-9]*$/ 208/ - s/ 245[^0-9]*$/ 168/ - s/ 264[^0-9]*$/ 63/ - s/ 704[^0-9]*$/ 116/' /tmp/remote*.conf - fi - for f in /tmp/remote*.conf; do - /usr/bin/remotecfg $f - done -fi diff --git a/projects/Amlogic/filesystem/usr/lib/modules-load.d/meson-ir.conf b/projects/Amlogic/filesystem/usr/lib/modules-load.d/meson-ir.conf new file mode 100644 index 0000000000..ac9cc29d2c --- /dev/null +++ b/projects/Amlogic/filesystem/usr/lib/modules-load.d/meson-ir.conf @@ -0,0 +1 @@ +meson-ir diff --git a/projects/Amlogic/filesystem/usr/share/bootloader/update.sh b/projects/Amlogic/filesystem/usr/share/bootloader/update.sh index 1c6ea45be6..f5c35ca7cd 100755 --- a/projects/Amlogic/filesystem/usr/share/bootloader/update.sh +++ b/projects/Amlogic/filesystem/usr/share/bootloader/update.sh @@ -51,8 +51,6 @@ for arg in $(cat /proc/cmdline); do if [ -f "/proc/device-tree/le-dt-id" ] ; then LE_DT_ID=$(cat /proc/device-tree/le-dt-id) - else - echo "*** remember to update your device tree! ***" fi if [ -f "$UPDATE_DTB_IMG" ] ; then @@ -76,6 +74,15 @@ for arg in $(cat /proc/cmdline); do ;; esac fi + + 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 ..." + mount -o rw,remount $BOOT_ROOT + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT + fi + done ;; disk=*) echo "*** updating DISK partition label ..." diff --git a/projects/Amlogic/initramfs/platform_init b/projects/Amlogic/initramfs/platform_init index bf022c8ae1..b82a0a71e7 100755 --- a/projects/Amlogic/initramfs/platform_init +++ b/projects/Amlogic/initramfs/platform_init @@ -95,10 +95,6 @@ echo 0 > /sys/class/graphics/fb0/blank # Blank fb1 to prevent static noise echo 1 > /sys/class/graphics/fb1/blank -for part in /sys/block/*/queue/add_random; do - echo 0 > "$part" -done - # set smp_affinity # Binary Hex # CPU 0 0001 1 diff --git a/projects/Amlogic/options b/projects/Amlogic/options index 66ea947d91..c638ac569d 100644 --- a/projects/Amlogic/options +++ b/projects/Amlogic/options @@ -123,7 +123,7 @@ ATVCLIENT_SUPPORT="no" # Amlogic IR remote support (yes / no) - AMREMOTE_SUPPORT="yes" + AMREMOTE_SUPPORT="no" # build and install iSCSI support - iscsistart (yes / no) ISCSI_SUPPORT="no"