Skip to content

Commit

Permalink
Merge pull request #4949 from chewitt/amlogic-upstream
Browse files Browse the repository at this point in the history
bump Amlogic to something half-usable
  • Loading branch information
jernejsk authored Jan 16, 2021
2 parents d50db18 + c8f2abf commit c87a8f5
Show file tree
Hide file tree
Showing 247 changed files with 11,599 additions and 13,878 deletions.
18 changes: 4 additions & 14 deletions packages/audio/alsa-utils/scripts/soundconfig
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,16 @@ else
mixer $card Headphone 0db on
mixer $card 'AIF1 Slot 0 Digital DAC' on

# Amlogic G12 HDMI
# Amlogic G12A/G12B/SM1 HDMI
case $(dtname) in
azw,gsking-x)
mixer $card 'FRDDR_A SINK 1 SEL' 'OUT 0'
mixer $card 'FRDDR_A SRC 1 EN' on
mixer $card 'TDMOUT_A SRC SEL' 'IN 0'
mixer $card 'FRDDR_B SINK 1 SEL' 'OUT 0'
mixer $card 'FRDDR_B SRC 1 EN' on
mixer $card 'TDMOUT_B SRC SEL' 'IN 0'
mixer $card 'TOHDMITX' on
mixer $card 'TOHDMITX I2S SRC' 'I2S A'
;;
khadas,vim3)
azw,gsking-x|khadas,vim3*) #TDM_A
mixer $card 'FRDDR_A SINK 1 SEL' 'OUT 0'
mixer $card 'FRDDR_A SRC 1 EN' on
mixer $card 'TDMOUT_A SRC SEL' 'IN 0'
mixer $card 'TOHDMITX' on
mixer $card 'TOHDMITX I2S SRC' 'I2S A'
;;
*)
*) #TDM_B
mixer $card 'FRDDR_A SINK 1 SEL' 'OUT 1'
mixer $card 'FRDDR_A SRC 1 EN' on
mixer $card 'TDMOUT_B SRC SEL' 'IN 0'
Expand All @@ -156,7 +146,7 @@ else
;;
esac

# Amlogic G12 S/PDIF
# Amlogic G12A/G12B/SM1 S/PDIF
mixer $card 'FRDDR_B SINK 1 SEL' 'OUT 3'
mixer $card 'FRDDR_B SRC 1 EN' on
mixer $card 'SPDIFOUT SRC SEL' 'IN 1'
Expand Down
6 changes: 6 additions & 0 deletions packages/linux/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ PKG_STAMP="$KERNEL_TARGET $KERNEL_MAKE_EXTRACMD"
PKG_PATCH_DIRS="$LINUX"

case "$LINUX" in
amlogic)
PKG_VERSION="7c53f6b671f4aba70ff15e1b05148b10d58c2837" # 5.11-rc3
PKG_SHA256="30206f178c9c151a0c387c7967800bc0bf89a893958241a3add0098d443f323a"
PKG_URL="https://github.com/torvalds/linux/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz"
;;
raspberrypi)
PKG_VERSION="e9505f4612646533f53813aabef5ca040b0ea49d" # 5.10.7
PKG_SHA256="2d6e3637dbe328161161cbdede2902e0aaaa979bd0179a40e14d2960a61de593"
Expand Down
7 changes: 0 additions & 7 deletions packages/sysutils/busybox/scripts/ledfix
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@ case $(dtsoc) in
done
;;
esac

# add device-specific led handling here
case $(dtname) in
khadas,vim3*)
echo "255" > /sys/devices/platform/leds/leds/vim3\:red/brightness
;;
esac
9 changes: 6 additions & 3 deletions packages/sysutils/ethmactool/scripts/ethmactool-config
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ from_cmdline() {
}

aml_from_efuse_gxbb() {
if [ -e /sys/devices/platform/efuse/efuse0/nvmem ] ; then
if [ -e /sys/devices/platform/efuse/efuse0/nvmem ]; then
MAC=$(od -x -A n -j 0x34 -N 6 /sys/bus/nvmem/devices/efuse0/nvmem | tr -d ' ')
MAC=${MAC:2:2}${MAC:0:2}${MAC:6:2}${MAC:4:2}${MAC:10:2}${MAC:8:2}
fi
}

aml_from_efuse_gxl() {
if [ -e /sys/devices/platform/efuse/efuse0/nvmem ] ; then
if [ -e /sys/devices/platform/efuse/efuse0/nvmem ]; then
MAC=$(cat /sys/devices/platform/efuse/efuse0/nvmem)
fi
}

aml_from_cpu_sn() {
if [ -e /sys/bus/platform/devices/firmware\:secure-monitor/serial ] ; then
if [ -e /sys/bus/platform/devices/secure-monitor/serial ]; then
MAC=$(cat /sys/bus/platform/devices/secure-monitor/serial 2>/dev/null | cut -b-12)
fixup_self_mac
elif [ -e /sys/bus/platform/devices/firmware\:secure-monitor/serial ]; then
MAC=$(cat /sys/bus/platform/devices/firmware\:secure-monitor/serial 2>/dev/null | cut -b-12)
fixup_self_mac
fi
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/amlogic-boot-fip/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

PKG_NAME="amlogic-boot-fip"
PKG_LICENSE="nonfree"
PKG_VERSION="c89bc11d2904e819baed20c7ddba5b5b42a09141"
PKG_SHA256="63f691f99aee93fe3a917d4b28fc67335a70f14ea3cec544d79983aff62062c9"
PKG_VERSION="a7b126764c0138579ba5eb74641f960fb67ab706"
PKG_SHA256="15e5c519b9c9c417b9c5ca3aaf7d83d0b6c142f11c9162cdaef05fab3fbcb2ce"
PKG_SITE="https://github.com/LibreELEC/amlogic-boot-fip"
PKG_URL="https://github.com/LibreELEC/amlogic-boot-fip/archive/${PKG_VERSION}.tar.gz"
PKG_LONGDESC="Firmware Image Package (FIP) sources used to sign Amlogic u-boot binaries in LibreELEC images"
Expand Down
12 changes: 7 additions & 5 deletions projects/Amlogic/bootloader/canupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

# detect legacy kernel installs and abort to prevent upgrades
if [ "$(uname -r)" = "3.14.29" ]; then
echo "Update from 3.14 is not supported!"
sleep 10
exit 1
fi
case $(uname -r) in
3.14*|4.9*)
echo "Updates from Amlogic vendor kernels are not supported!"
sleep 10
exit 1
;;
esac

# allow upgrades between aarch64 and arm images
PROJECT=$("$1" | cut -d. -f1)
Expand Down
3 changes: 3 additions & 0 deletions projects/Amlogic/bootloader/mkimage
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ mkimage_dtb(){
if [ "$DTB" != "@@DTB_NAME@@" ]; then
echo "image: copying device tree"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/$DTB" ::
if [ "$DTB" = "meson-g12b-odroid-n2.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-odroid-n2-plus.dtb" ::
fi
else
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb" ::
Expand Down
10 changes: 0 additions & 10 deletions projects/Amlogic/bootloader/release
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ mkdir -p "$DSTDIR"
mkdir -p "$DSTDIR/dtb"
case ${DEVICE:-$PROJECT} in
AMLGX)
cp -a "$SRCDIR"/*gxbb*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxl*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxm*.dtb "$DSTDIR/dtb"
;;
AMLG12)
cp -a "$SRCDIR"/*g12a*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*g12b*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*sm1*.dtb "$DSTDIR/dtb"
;;
*)
cp -a "$SRCDIR"/*gxbb*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxl*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxm*.dtb "$DSTDIR/dtb"
Expand Down
2 changes: 2 additions & 0 deletions projects/Amlogic/config/kernel-firmware.dat
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ath9k_htc
ath10k/QCA9377
mediatek/mt7668pr2h.bin
qca/nvm_00230302.bin
qca/rampatch_00230302.bin
rtlwifi/rtl8192cufw_TMSC.bin
rtlwifi/rtl8192cufw.bin
rtlwifi/rtl8192eu_nic.bin
Expand Down
37 changes: 0 additions & 37 deletions projects/Amlogic/devices/AMLG12/options

This file was deleted.

2 changes: 1 addition & 1 deletion projects/Amlogic/devices/AMLGX/options
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
KODIPLAYER_DRIVER="$OPENGLES"

# Mali GPU family
MALI_FAMILY="450 t820"
MALI_FAMILY="450 t820 g31 g52"

# Set the addon project
ADDON_PROJECT="ARMv8"
4 changes: 2 additions & 2 deletions projects/Amlogic/filesystem/usr/bin/emmctool
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do_detect(){
echo -n d0074000.mmc > /sys/bus/platform/drivers/meson-gx-mmc/unbind
echo -n d0074000.mmc > /sys/bus/platform/drivers/meson-gx-mmc/bind
sleep 1
parted -s "${EMMC}" unit s print
parted -s "${EMMC}" print
}

do_info(){
Expand Down Expand Up @@ -100,7 +100,7 @@ do_resize(){
if [ -f "/var/media/${DISKLABEL}/.please_resize_me" ]; then
rm "/var/media/${DISKLABEL}/.please_resize_me"
fi
parted -s "${EMMC}" unit s print
parted -s "${EMMC}" print
}

do_storage(){
Expand Down
Loading

0 comments on commit c87a8f5

Please sign in to comment.