Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/audio/alsa-lib/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ PKG_CONFIGURE_OPTS_TARGET="${PKG_ALSA_DEBUG} \
--disable-dependency-tracking \
--disable-largefile \
--with-plugindir=/usr/lib/alsa \
--disable-python"
--disable-python \
--enable-ucm \
--enable-topology"

post_configure_target() {
sed -i 's/.*PKGLIBDIR.*/#define PKGLIBDIR ""/' include/config.h
Expand Down
2 changes: 2 additions & 0 deletions packages/audio/alsa-utils/scripts/soundconfig
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ mixer() {
mixer "$card" 'AIU ACODEC SRC' 'I2S'
mixer "$card" 'AIU ACODEC OUT EN' on
;;
mediatek,mt**)
alsactl init # force init
esac

# ES8316 headphone jack
Expand Down
7 changes: 7 additions & 0 deletions packages/linux/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ case "${LINUX}" in
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
PKG_PATCH_DIRS="default rockchip"
;;
mediatek)
PKG_VERSION="00b5f937ab02ee6def025787c8fb07c6ef544ab2" # 6.19-rc4 + Collabora + Armbian patches
PKG_SHA256="bc4ff021a917fc7bf0dc845817d3a8cefe50416d7d00e5d4fd6906e9a3ae2483"
PKG_URL="https://github.com/rpardini/linux/archive/${PKG_VERSION}.tar.gz"
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
PKG_PATCH_DIRS="default" # soon to be added: mediatek
;;
*)
PKG_VERSION="6.18.3"
PKG_SHA256="7a8879167b89c4bae077d6f39c4f2130769f05dbdad2aad914adab9afb7d7f9a"
Expand Down
2 changes: 1 addition & 1 deletion packages/sysutils/busybox/scripts/dthelper
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

COMPATIBLE=$(cat /proc/device-tree/compatible 2>/dev/null | tr -d '\000' | sed -n -e 's/.*\(allwinner\|amlogic\|fsl\|nxp\|qcom\|raspberrypi\|rockchip\|samsung\).*/\1/p')
COMPATIBLE=$(cat /proc/device-tree/compatible 2>/dev/null | tr -d '\000' | sed -n -e 's/.*\(allwinner\|amlogic\|fsl\|mediatek\|nxp\|qcom\|raspberrypi\|rockchip\|samsung\).*/\1/p')

do_dtfile() {
if [[ -n $(find /flash -name extlinux.conf) ]]; then
Expand Down
1 change: 1 addition & 0 deletions packages/tools/u-boot/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ make_target() {
echo "UBOOT_SYSTEM must be set to build an image"
echo "see './scripts/uboot_helper' for more information"
else
[ "$(${ROOT}/${SCRIPTS}/uboot_helper ${PROJECT} ${DEVICE} ${UBOOT_SYSTEM} config)" = "none" ] && return 0
[ "${BUILD_WITH_DEBUG}" = "yes" ] && PKG_DEBUG=1 || PKG_DEBUG=0
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm make mrproper
[ -n "${UBOOT_FIRMWARE}" ] && find_file_path bootloader/firmware && . ${FOUND_PATH}
Expand Down
19 changes: 19 additions & 0 deletions projects/Mediatek/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Mediatek

This project is for Mediatek SoC devices

## Devices

**Genio 1200 / MT8395**
* [Radxa NIO-12L](devices/Genio)

## Useful debug commands

* `cat /sys/kernel/debug/dri/0/state`
* `cat /sys/kernel/debug/dri/0/framebuffer`
* `cat /sys/kernel/debug/dma_buf/bufinfo`
* `cat /sys/kernel/debug/cec/cec0/status`
* `hexdump -C /sys/class/drm/card0-HDMI-A-1/edid`
* `edid-decode /sys/class/drm/card0-HDMI-A-1/edid`
* `cat /sys/kernel/debug/clk/clk_summary`
* `cat /sys/kernel/debug/regulator/regulator_summary`
4 changes: 4 additions & 0 deletions projects/Mediatek/bootloader/canupdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

exit 1 # no
2 changes: 2 additions & 0 deletions projects/Mediatek/bootloader/firmware
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

echo "This is Mediatek/bootloader/firmware file"
4 changes: 4 additions & 0 deletions projects/Mediatek/bootloader/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

echo "This is Mediatek/bootloader/install file"
4 changes: 4 additions & 0 deletions projects/Mediatek/bootloader/mkimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

echo "This is Mediatek/bootloader/mkimage"
11 changes: 11 additions & 0 deletions projects/Mediatek/bootloader/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

echo "This is Mediatek/bootloader/install file"

SRCDIR="${BUILD}"/image/system/usr/share/bootloader
DSTDIR="${RELEASE_DIR}"/3rdparty/bootloader

mkdir -pv "${DSTDIR}"

cp -av "${SRCDIR}"/*.dtb "${DSTDIR}"
34 changes: 34 additions & 0 deletions projects/Mediatek/config/kernel-firmware.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
mediatek/*
ath9k_htc
mediatek/mt7668pr2h.bin
mediatek/*MT7961*.bin
mrvl/sd8897_uapsta.bin
mt7662.bin
mt7662_rom_patch.bin
rtlwifi/rtl8188eufw.bin
rtlwifi/rtl8192cufw_TMSC.bin
rtlwifi/rtl8192cufw.bin
rtlwifi/rtl8192eu_nic.bin
rtlwifi/rtl8723bs_nic.bin
rtw88/rtw8821a_fw.bin
rtw88/rtw8821c_fw.bin
rtw88/rtw8822c_fw.bin
rtw88/rtw8822c_wow_fw.bin
rtw89/rtw8852b_fw.bin
rtw89/rtw8852b_fw-1.bin
rtl_bt/rtl8723bs_fw.bin
rtl_bt/rtl8723bs_config-OBDA8723.bin
rtl_bt/rtl8761bu_config.bin
rtl_bt/rtl8761bu_fw.bin
rtl_bt/rtl8821c_config.bin
rtl_bt/rtl8821c_fw.bin
rtl_bt/rtl8822cs_config.bin
rtl_bt/rtl8822cs_fw.bin
rtl_bt/rtl8822cu_config.bin
rtl_bt/rtl8822cu_fw.bin
rtl_bt/rtl8852bu_fw.bin
rtl_bt/rtl8852bu_config.bin
rtl_nic/rtl8125b-2.fw
rtl_nic/rtl8153a-3.fw
rtl_nic/rtl8153b-2.fw
rtl_nic/rtl8168h-2.fw
7 changes: 7 additions & 0 deletions projects/Mediatek/devices/Genio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mediatek Genio

Support for the MT8395 SoC

**Build**

* `PROJECT=Mediatek DEVICE=Genio ARCH=aarch64 DTB=mt8395-radxa-nio-12l-extra UBOOT_SYSTEM=nio-12l make image`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm/mali/*
44 changes: 44 additions & 0 deletions projects/Mediatek/devices/Genio/kodi/appliance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<settings version="1">
<section id="system">
<category id="display">
<group id="1">
<setting id="videoscreen.blankdisplays">
<visible>false</visible>
</setting>
<setting id="videoscreen.limitguisize">
<default>3</default>
<visible>true</visible>
</setting>
</group>
<group id="4">
<setting id="videoscreen.noofbuffers">
<default>2</default>
<visible>false</visible>
</setting>
</group>
</category>
<category id="audio">
<group id="1">
<setting id="audiooutput.audiodevice">
<default>ALSA:hdmi:CARD=HDMI,DEV=0</default>
</setting>
</group>
<group id="3">
<visible>false</visible>
<setting id="audiooutput.passthrough">
<default>false</default>
</setting>
</group>
</category>
</section>
<section id="player">
<category id="videoplayer">
<group id="3">
<setting id="videoplayer.primeallowhwdeinterlace">
<default>false</default>
</setting>
</group>
</category>
</section>
</settings>
30 changes: 30 additions & 0 deletions projects/Mediatek/devices/Genio/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
################################################################################
# setup device defaults
################################################################################

# The TARGET_CPU variable controls which processor should be targeted for
# generated code.
case $TARGET_ARCH in
aarch64)
TARGET_CPU="cortex-a76.cortex-a55"
TARGET_CPU_FLAGS="+crc+crypto"
;;
esac

# Kernel to use
LINUX="mediatek"

# Kernel target
KERNEL_TARGET="Image"

# Graphic drivers to use
GRAPHIC_DRIVERS="panfrost"

# kernel serial console
EXTRA_CMDLINE="console=ttyS0,921600 console=tty0 coherent_pool=2M cec.debounce_ms=5000 mem=3838M systemd.debug_shell=ttyS0 ssh"

# set the addon project
ADDON_PROJECT="ARMv8"

# additional packages
ADDITIONAL_PACKAGES+=" pciutils"
21 changes: 21 additions & 0 deletions projects/Mediatek/filesystem/usr/bin/cputemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

# try to find temperature of cpu
for thermal_zone in /sys/devices/virtual/thermal/thermal_zone*; do
[ -d "$thermal_zone" ] || continue
if [[ "$(cat $thermal_zone/type)" =~ '(cpu|soc|package)-thermal' ]]; then
TEMP="$(cat $thermal_zone/temp)"
break
fi
done

# fallback to highest temperature
if [ -z "$TEMP" ]; then
TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone*/temp | sort -n | tail -1)
fi

echo "$(($TEMP / 1000)) C"
21 changes: 21 additions & 0 deletions projects/Mediatek/filesystem/usr/bin/gputemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

# try to find temperature of gpu
for thermal_zone in /sys/devices/virtual/thermal/thermal_zone*; do
[ -d "$thermal_zone" ] || continue
if [ "$(cat $thermal_zone/type)" = "gpu-thermal" ]; then
TEMP="$(cat $thermal_zone/temp)"
break
fi
done

# fallback to highest temperature
if [ -z "$TEMP" ]; then
TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone*/temp | sort -n | tail -1)
fi

echo "$(($TEMP / 1000)) C"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Sleep]
SuspendMode=false
HibernateMode=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
If.HDMI {
Condition {
Type ControlExists
Control "iface=CARD,name='HDMI Jack'"
}
True {
SectionDevice."HDMI1" {
Comment "HDMI output"
EnableSequence [
cset "name='HDMI_OUT_MUX' 1"
]
DisableSequence [
cset "name='HDMI_OUT_MUX' 0"
]
Value {
PlaybackPriority 200
PlaybackPCM "hw:${CardId},5"
JackControl "HDMI Jack"
}
}
}
}
SectionDevice."Headphones" {
Comment "Earphone speaker"
EnableSequence [
cset "name='HP Mux' Audio Playback"
]
DisableSequence [
cset "name='HP Mux' Open"
]
Value {
PlaybackPriority 400
PlaybackChannels 2
PlaybackPCM "hw:${CardId},16"
JackControl "Headphone Jack"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Syntax 4
SectionUseCase."HiFi" {
File "../../MediaTek/sof-mt8395-evk/HiFi.conf"
Comment "Play high quality music"
}
BootSequence [
cset "name='HP Mux' Audio Playback"
cset "name='LOL Mux' Open"
cset "name='MISO0_MUX' UL1_CH1"
cset "name='MISO1_MUX' UL1_CH1"
cset "name='ADC_L_Mux' Left Preamplifier"
cset "name='ADC_R_Mux' Right Preamplifier"
cset "name='ADC_3_Mux' Preamplifier"
cset "name='ETDM_OUT3_Clock_Source' a1sys_a2sys"
cset "name='PGA_L_Mux' AIN1"
cset "name='PGA_R_Mux' AIN2"
cset "name='PGA_3_Mux' AIN3"
cset "name='HDMI_OUT_MUX' Connect"
cset "name='DPTX_OUT_MUX' Disconnect"
cset "name='Lineout Volume' 10"
cset "name='Headset Volume' 2"
cset "name='PGA1 Volume' 4"
cset "name='PGA2 Volume' 4"
cset "name='PGA3 Volume' 4"
cset "name='O000 I000 Switch' on"
cset "name='O001 I001 Switch' on"
cset "name='O034 I168 Switch' on"
cset "name='O035 I169 Switch' on"
cset "name='O040 I002 Switch' on"
cset "name='O041 I003 Switch' on"
cset "name='O176 I070 Switch' on"
cset "name='O177 I071 Switch' on"
]
35 changes: 35 additions & 0 deletions projects/Mediatek/kodi/appliance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<settings version="1">
<section id="system">
<category id="display">
<group id="1">
<setting id="videoscreen.blankdisplays">
<visible>false</visible>
</setting>
<setting id="videoscreen.limitguisize">
<default>3</default>
<visible>true</visible>
</setting>
</group>
<group id="5">
<setting id="videoscreen.noofbuffers">
<default>2</default>
<visible>false</visible>
</setting>
</group>
</category>
<category id="audio">
<group id="1">
<setting id="audiooutput.audiodevice">
<default>ALSA:hdmi:CARD=HDMI,DEV=0</default>
</setting>
</group>
<group id="3">
<visible>false</visible>
<setting id="audiooutput.passthrough">
<default>false</default>
</setting>
</group>
</category>
</section>
</settings>
Loading