Skip to content

Commit

Permalink
Merge pull request #8759 from chewitt/amlogic-upstream
Browse files Browse the repository at this point in the history
amlogic: bump to Linux 6.8.y and prepare for u-boot 2024.04 plus misc bits
  • Loading branch information
CvH committed Mar 26, 2024
2 parents ed7686f + cfc938c commit f2286fe
Show file tree
Hide file tree
Showing 110 changed files with 4,899 additions and 3,309 deletions.
@@ -0,0 +1,42 @@
From 496ee7ac49a732b051fe0f717a946b0a35f90737 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 23 Mar 2024 09:15:55 +0000
Subject: [PATCH] os_dep: update os_intfs.c/usb_intf.c for kernel 6.8

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
os_dep/os_intfs.c | 4 ++++
os_dep/usb_intf.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c
index 5feaaf4..1831d6c 100644
--- a/os_dep/os_intfs.c
+++ b/os_dep/os_intfs.c
@@ -35,6 +35,10 @@
#include <rtw_br_ext.h>
#endif //CONFIG_BR_EXT

+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0))
+#define strlcpy strscpy
+#endif
+
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
MODULE_AUTHOR("Realtek Semiconductor Corp.");
diff --git a/os_dep/usb_intf.c b/os_dep/usb_intf.c
index a2353e3..2961a81 100644
--- a/os_dep/usb_intf.c
+++ b/os_dep/usb_intf.c
@@ -148,7 +148,7 @@ struct rtw_usb_drv rtl8192d_usb_drv = {
.usbdrv.supports_autosuspend = 1,
#endif

- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,
--
2.34.1

4 changes: 2 additions & 2 deletions packages/linux/package.mk
Expand Up @@ -16,8 +16,8 @@ PKG_PATCH_DIRS="${LINUX}"

case "${LINUX}" in
amlogic)
PKG_VERSION="004dcea13dc10acaf1486d9939be4c793834c13c" # 6.7.5
PKG_SHA256="65911f37f072778f60f77821e8c4cf67e7a8aeca8a290fbbb743ee877048a676"
PKG_VERSION="e8f897f4afef0031fe618a8e94127a0934896aba" # 6.8.0
PKG_SHA256="52608771cc42196f0a7a71a93270a27ca5f7ba1d9280fb398e521b0620a7a3ac"
PKG_URL="https://github.com/torvalds/linux/archive/${PKG_VERSION}.tar.gz"
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
PKG_PATCH_DIRS="default"
Expand Down
3 changes: 3 additions & 0 deletions packages/sysutils/busybox/package.mk
Expand Up @@ -103,6 +103,9 @@ makeinstall_target() {
cp ${PKG_DIR}/scripts/update-bootloader-edid-rpi ${INSTALL}/usr/bin/update-bootloader-edid
cp ${PKG_DIR}/scripts/getedid-drm ${INSTALL}/usr/bin/getedid
fi
if [ "${PROJECT}" = "Amlogic" ]; then
cp ${PKG_DIR}/scripts/update-bootloader-edid-amlogic ${INSTALL}/usr/bin/getedid
fi
cp ${PKG_DIR}/scripts/createlog ${INSTALL}/usr/bin/
cp ${PKG_DIR}/scripts/dthelper ${INSTALL}/usr/bin
ln -sf dthelper ${INSTALL}/usr/bin/dtfile
Expand Down
89 changes: 89 additions & 0 deletions packages/sysutils/busybox/scripts/update-bootloader-edid-amlogic
@@ -0,0 +1,89 @@
#!/bin/bash

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv)

do_install(){
# create the persistent firmware dir
mkdir -p "/storage/.config/firmware/edid"

# capture the raw edid file
if [ ! -e /storage/.config/firmware/edid/edid.bin ]; then
cat "/sys/class/drm/card0-HDMI-A-1/edid" > "/storage/.config/firmware/edid/edid.bin"
else
echo "info: using existing edid.bin"
fi

# create the cpio file
mkdir -p "/storage/cpio/lib/firmware/edid"
cp "/storage/.config/firmware/edid/edid.bin" "/storage/cpio/lib/firmware/edid/"
cd "/storage/cpio"
find . -print | cpio -ov -H newc > "/storage/.config/firmware/edid/edid.cpio"

# mount /flash rw
mount -o remount,rw /flash

# copy the cpio file
cp "/storage/.config/firmware/edid/edid.cpio" "/flash/edid.cpio"

# cleanup cpio dir
rm -rf "/storage/cpio"

# determine boot method and set params
if [ -f "/flash/extlinux/extlinux.conf" ]; then
FILE="/flash/extlinux/extlinux.conf"
if grep -q "initrd=/edid.cpio" "${FILE}" ; then
echo "error: ${FILE} already contains edid.cpio, aborting!"
exit 1
else
cp "${FILE}" "${FILE}.backup"
sed -i "/ APPEND/s/$/ drm.edid_firmware=edid\/edid.bin video=HDMI-A-1:D/" "${FILE}"
echo "info: edid setup complete!"
exit 0
fi
else
FILE="/flash/uEnv.ini"
if grep -q "initrd=/edid.cpio" "${FILE}" ; then
echo "error: ${FILE} already contains edid.cpio info .. aborting!"
exit 1
else
cp "${FILE}" "${FILE}.backup"
sed -i "/ bootargs/s/$/ drm.edid_firmware=edid\/edid.bin video=HDMI-A-1:D/" "${FILE}"
echo "info: edid setup complete!"
exit 0
fi
fi
}

do_cleanup(){
rm "/storage/.config/firmware/edid/edid.bin"
rm "/storage/.config/firmware/edid/edid.cpio"
mount -o remount,rw /flash
rm "/flash/edid.cpio"
if [ -f "/flash/extlinux/extlinux.conf" ]; then
FILE="/flash/extlinux/extlinux.conf"
else
FILE="/flash/uEnv.ini"
fi
cp "${FILE}.backup" "${FILE}"
mount -o remount,ro /flash
}

do_usage(){
echo "usage: getedid {create|delete}"
exit 0
}

case $1 in
create)
do_install
;;
delete)
do_cleanup
;;
*)
do_usage
;;
esac

exit
4 changes: 4 additions & 0 deletions packages/sysutils/systemd/hwdb.d/70-local-keyboard.hwdb
Expand Up @@ -22,6 +22,10 @@ evdev:input:b0005v0957p1001*
KEYBOARD_KEY_70045=volumeup
KEYBOARD_KEY_70069=volumedown

# google tv remote
evdev:name:*Chromecast Remote*:*
KEYBOARD_KEY_c0041=enter

# g7bts remote
evdev:input:b0005v045Ep0041e0300*
KEYBOARD_KEY_c0041=enter
Expand Down
26 changes: 5 additions & 21 deletions projects/Amlogic/bootloader/mkimage
Expand Up @@ -26,7 +26,7 @@ mkimage_bootini(){
mkimage_uEnv(){
echo "image: creating uEnv.ini"
cat << EOF > "${LE_TMP}/uEnv.ini"
dtb_name=/dtb/${DTB}
dtb_name=/amlogic/${DTB}
bootargs=boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s "${LE_TMP}/uEnv.ini" ::
Expand All @@ -38,7 +38,7 @@ mkimage_extlinux(){
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDT /${DTB}
FDT /amlogic/${DTB}
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::
Expand All @@ -50,31 +50,15 @@ mkimage_extlinux_fdtdir(){
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
FDTDIR /amlogic/
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::
}

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" ::
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-odroid-n2l.dtb" ::
elif [ "$DTB" = "meson-g12b-gtking.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-gtking-pro.dtb" ::
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-gsking-x.dtb" ::
elif [ "$DTB" = "meson-gxl-s905x-libretech-cc.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-gxl-s905x-libretech-cc-v2.dtb" ::
elif [ "$DTB" = "meson-sm1-odroid-c4.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-sm1-odroid-hc4.dtb" ::
fi
else
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb" ::
fi
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/amlogic" ::
}

case "${UBOOT_SYSTEM}" in
Expand Down
15 changes: 8 additions & 7 deletions projects/Amlogic/bootloader/release
Expand Up @@ -11,14 +11,15 @@ mkdir -p "$DSTDIR"
cp -av "${FOUND_PATH}" "$DSTDIR/boot.ini"
fi

mkdir -p "$DSTDIR/dtb"
mkdir -p "$DSTDIR/amlogic"
ln -sf "$DSTDIR/amlogic" "$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"
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/amlogic"
cp -a "$SRCDIR"/*gxl*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*gxm*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*g12a*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*g12b*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*sm1*.dtb "$DSTDIR/amlogic"
;;
esac
15 changes: 12 additions & 3 deletions projects/Amlogic/bootloader/update.sh
Expand Up @@ -22,7 +22,16 @@
# mount $BOOT_ROOT rw
mount -o remount,rw $BOOT_ROOT

# update extlinux device trees
# update /amlogic device trees
if [ -d $BOOT_ROOT/amlogic ]; then
for dtbfile in $BOOT_ROOT/amlogic/*.dtb ; do
dtb=$(basename $dtbfile)
echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true
done
fi

# update /extlinux device trees
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
for dtbfile in $BOOT_ROOT/*.dtb ; do
dtb=$(basename $dtbfile)
Expand All @@ -31,8 +40,8 @@
done
fi

# update box device trees
if [ -f $BOOT_ROOT/uEnv.ini ]; then
# update /dtb device trees
if [ -d $BOOT_ROOT/dtb ]; then
for dtbfile in $BOOT_ROOT/dtb/*.dtb ; do
dtb=$(basename $dtbfile)
echo "Updating $dtb"
Expand Down
@@ -1,7 +1,7 @@
From 7b7853885891650fff72c6133d24d34998b658fb Mon Sep 17 00:00:00 2001
From fa91cacc8756959b9b04b2cd3d369888b9a19e82 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 13 Apr 2019 05:41:51 +0000
Subject: [PATCH 01/64] LOCAL: set meson-gx cma pool to 896MB
Subject: [PATCH 01/53] LOCAL: set meson-gx cma pool to 896MB

This change sets the CMA pool to a larger 896MB! value for vdec use

Expand Down
@@ -1,7 +1,7 @@
From b06263d189fe8c6afc4b6bfe0bd50823042b39fc Mon Sep 17 00:00:00 2001
From db61fd1f5ac1a4b39f7699ef5583db1464f2a419 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Wed, 14 Aug 2019 19:58:14 +0000
Subject: [PATCH 02/64] LOCAL: set meson-g12 cma pool to 896MB
Subject: [PATCH 02/53] LOCAL: set meson-g12 cma pool to 896MB

This change sets the CMA pool to a larger 896MB! value for vdec use

Expand Down
@@ -1,7 +1,7 @@
From cc51fd5a5dc1eedeb89f802f9479d3510817bebe Mon Sep 17 00:00:00 2001
From ee6ecf00c056184730623b0a09f8e1ce0adb3d24 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 13 Apr 2019 05:45:18 +0000
Subject: [PATCH 03/64] LOCAL: arm64: fix Kodi sysinfo CPU information
Subject: [PATCH 03/53] LOCAL: arm64: fix Kodi sysinfo CPU information

This allows the CPU information to show in the Kodi sysinfo screen, e.g.

Expand All @@ -13,10 +13,10 @@ Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index a257da7b56fe..de893e3a5e57 100644
index 47043c0d95ec..03410a9fac77 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -192,8 +192,7 @@ static int c_show(struct seq_file *m, void *v)
@@ -190,8 +190,7 @@ static int c_show(struct seq_file *m, void *v)
* "processor". Give glibc what it expects.
*/
seq_printf(m, "processor\t: %d\n", i);
Expand Down
@@ -1,7 +1,7 @@
From 8686b57a5828a674d07954da9d0993b84202966b Mon Sep 17 00:00:00 2001
From 18375f3ce86dcec9a07f711b696aefb6fcb79829 Mon Sep 17 00:00:00 2001
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Thu, 3 Nov 2016 15:29:23 +0100
Subject: [PATCH 04/64] LOCAL: arm64: meson: add Amlogic Meson GX PM Suspend
Subject: [PATCH 04/53] LOCAL: arm64: meson: add Amlogic Meson GX PM Suspend

The Amlogic Meson GX SoCs uses a non-standard argument to the
PSCI CPU_SUSPEND call to enter system suspend.
Expand Down
@@ -1,7 +1,7 @@
From feabed1f718912863b14a051074fc5feb7e6e55a Mon Sep 17 00:00:00 2001
From 346f8f56697d21901ca2c5d48c7beecc654131c0 Mon Sep 17 00:00:00 2001
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Thu, 3 Nov 2016 15:29:25 +0100
Subject: [PATCH 05/64] LOCAL: arm64: dts: meson: add support for GX PM and
Subject: [PATCH 05/53] LOCAL: arm64: dts: meson: add support for GX PM and
Virtual RTC

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Expand Down
@@ -1,7 +1,7 @@
From 3f431bfc58eb527290ad1b461e5e291536a675cf Mon Sep 17 00:00:00 2001
From e288d4c79fb45f1af148b279bcfd091f770e9070 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 21 Jan 2021 01:35:36 +0000
Subject: [PATCH 06/64] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to
Subject: [PATCH 06/53] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to
Khadas VIM

Add aliases to ensure the vrtc time (which normally proves first) is /dev/rtc1
Expand Down
@@ -1,7 +1,7 @@
From 9f5b04acf796cb5c423de664296dfd66b3c98975 Mon Sep 17 00:00:00 2001
From 1ebc6f1a726d896fb8c72ed5e86423ad2485eea1 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 6 Nov 2021 13:01:08 +0000
Subject: [PATCH 07/64] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to
Subject: [PATCH 07/53] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to
Khadas VIM2

Add aliases to ensure the vrtc time (which normally proves first) is /dev/rtc1
Expand Down
@@ -1,7 +1,7 @@
From 9d15c5b5d125d392bbcca8d74f9c76cbbd6157e8 Mon Sep 17 00:00:00 2001
From 83e3e72c22bd9261d248c2dda723d5fb3abd4ab9 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Mon, 1 Feb 2021 19:27:40 +0000
Subject: [PATCH 08/64] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to Minix
Subject: [PATCH 08/53] LOCAL: arm64: dts: meson: add rtc/vrtc aliases to Minix
NEO U9-H

Add node aliases to prevent meson-vrtc from claiming /dev/rtc0
Expand Down
@@ -1,7 +1,7 @@
From ef1379f8920505d862ae335355afa60ff564554b Mon Sep 17 00:00:00 2001
From b419174ce9cd28aa55673140319aa4317922d0d7 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Sun, 17 Apr 2022 04:37:48 +0000
Subject: [PATCH 09/64] LOCAL: ASoC: meson: assign internal PCM
Subject: [PATCH 09/53] LOCAL: ASoC: meson: assign internal PCM
chmap/ELD/IEC958 kctls to device 0

On SoC sound devices utilizing codec2codec DAI links with an HDMI codec the kctls
Expand All @@ -24,10 +24,10 @@ Tested-by: Christian Hewitt <christianshewitt@gmail.com>
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a11cd7d6295f..94269e485873 100644
index 41103e5c43ce..0db7fe63911e 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2547,7 +2547,10 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
@@ -2581,7 +2581,10 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
knew.name = "Playback Channel Map";
else
knew.name = "Capture Channel Map";
Expand All @@ -40,10 +40,10 @@ index a11cd7d6295f..94269e485873 100644
knew.private_value = private_value;
info->kctl = snd_ctl_new1(&knew, info);
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 0938671700c6..3131a20f1b21 100644
index d3abb7ce2153..e06b28c7e5ba 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -801,7 +801,8 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
@@ -802,7 +802,8 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
if (!kctl)
return -ENOMEM;

Expand Down

0 comments on commit f2286fe

Please sign in to comment.