device/pine64-pinephonepro: Move to commmunity (MR 3238)

This commit is contained in:
Martijn Braam 2022-06-15 17:38:38 +02:00 committed by Oliver Smith
parent 02aaa6eae6
commit 484b23f7a0
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
12 changed files with 0 additions and 0 deletions

View file

@ -1,111 +0,0 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Martijn Braam <martijn@brixit.nl>
pkgname=device-pine64-pinephonepro
pkgdesc="PINE64 PinePhone Pro"
pkgver=2.1
pkgrel=2
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
# pmb:strict is required for grub
options="!check !archcheck pmb:strict"
depends="
alsa-ucm-conf>=1.2.6.2
eg25-manager>=0.4.2
iw
linux-pine64-pinephonepro
mesa-dri-gallium
postmarketos-base
fwupd
fwupd-plugin-modem_manager
fwupd-plugin-fastboot
"
makedepends="
devicepkg-dev
grub
grub-efi
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
install="
$pkgname.post-install
$pkgname.post-upgrade
"
source="
deviceinfo
grub.cfg
grub_early.cfg
ucm/HiFi.conf
ucm/PinePhonePro.conf
ucm/VoiceCall.conf
ppkb.sh
"
build() {
devicepkg_build $startdir $pkgname
grub-mkimage \
--config="$srcdir/grub_early.cfg" \
--prefix="" \
--output="bootaa64.efi" \
--format="arm64-efi" \
--compression="xz" \
\
all_video \
cat \
configfile \
disk \
echo \
efi_gop \
fat \
gzio \
help \
iso9660 \
linux \
ls \
normal \
part_gpt \
part_msdos \
search \
search_label \
test \
true
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 -t "$pkgdir"/boot/grub \
"$srcdir"/grub.cfg
install -Dm644 -t "$pkgdir"/boot/EFI/Boot \
"$srcdir"/bootaa64.efi
install -Dm644 -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/simple-card \
"$srcdir"/PinePhonePro.conf \
"$srcdir"/HiFi.conf \
"$srcdir"/VoiceCall.conf
# Keyboard config
install -Dm755 "$srcdir"/ppkb.sh "$pkgdir"/etc/profile.d/ppkb.sh
}
nonfree_firmware() {
pkgdesc="Wifi, Bluetooth and video-out firmware"
depends="
firmware-pine64-pinebookpro
linux-firmware-rtlwifi
linux-firmware-rtl_bt
firmware-pine64-rtl8723bt
firmware-pine64-ov5640
"
mkdir "$subpkgdir"
}
sha512sums="
195ea87f346e09b781d7925bcb7752a25d27f4396e1512ae15582526c062261516f918703c633730f56becb9f5c94020cc46ef6dc9d960b4a29208f03e3b70b8 deviceinfo
e69752fc7f2b8552ba2e1e6da5b6bec0e284c7f14bc09576c862faeb5154a44522535a919ae5aca33a22fd14557e802595a7c96c59b9362c5ac5b991a8eac5fc grub.cfg
0f9357d4eea089628fbceb1e3e96d21a3f4329aeb6743158a6f877f967ef274506404eba949d5f01b7e1adea149f9a3aef992a5e8cd4181f93ab00909b1c5ecd grub_early.cfg
ac22c856af81d00aa6a349b68cf9e8645bf38277d9aafd07f1f46f5f932f48d37b9dfdcc8772fff4027f914c9b4c3b4a11c51bd9f2aa1abbc53abd3f54adb818 HiFi.conf
c57dae885c9a5f366f18b38a3ce3e21627baaf014724537eced9e8d6ac3ca61ade42b9fcf84db350b1e64742760e8cf4fe10639d41052387927238e85c3c4769 PinePhonePro.conf
e978876bda8874e30df75c80554ccbbc0dd202c852ecae0b5c1a0d845402a630962afc2691c6f7d5f478fb0e4be045af4ef62ad0b1ce77f62fe2f155dc0a9cff VoiceCall.conf
43f67e94491791685cdbb4874bb3034b1d297bdf3d23e7405c45ba8c58de72b4fb6a9943b79f46ef7b8f4dbc4d9db254ebec8eb3453d720a5a8fad277c6a9d88 ppkb.sh
"

View file

@ -1,3 +0,0 @@
#!/bin/sh
rc-update add eg25-manager default

View file

@ -1 +0,0 @@
device-pine64-pinephonepro.post-install

View file

@ -1,28 +0,0 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="PINE64 PinePhone Pro"
deviceinfo_manufacturer="PINE64"
deviceinfo_codename="pine64-pinephonepro"
deviceinfo_year="2021"
deviceinfo_modules_initfs="gpu_sched dw_wdt fusb302 panel_himax_hx8394 goodix_ts"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_gpu_accelerated="true"
deviceinfo_chassis="handset"
deviceinfo_keyboard="true"
deviceinfo_external_storage="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1440"
deviceinfo_getty="ttyS2;115200"
# Installer related
deviceinfo_dev_internal_storage="/dev/mmcblk2"
deviceinfo_dev_internal_storage_repartition="true"
# Bootloader related
deviceinfo_flash_method="none"
deviceinfo_boot_filesystem="fat32"
deviceinfo_partition_type="gpt"

View file

@ -1,6 +0,0 @@
timeout=0
menuentry "postmarketOS" {
linux ($root)/vmlinuz console=tty0 earlycon=uart8250,mmio32,0xff1a0000 console=ttyS2,115200 panic=10 coherent_pool=1M loglevel=5 mem_sleep_default=s2idle PMOS_NO_OUTPUT_REDIRECT fw_devlink=off
initrd ($root)/initramfs
}

View file

@ -1,2 +0,0 @@
search --no-floppy --set=root --label "pmOS_boot"
set prefix=($root)/grub

View file

@ -1,2 +0,0 @@
#!/bin/sh
export XKB_DEFAULT_MODEL=ppkb

View file

@ -1,194 +0,0 @@
SectionVerb {
EnableSequence [
### Default rt5640 configuration, copied from /codecs/rt5640/EnableSeq.conf ###
# RT5640 default output routing
cset "name='DAC MIXL INF1 Switch' on"
cset "name='DAC MIXR INF1 Switch' on"
cset "name='Stereo DAC MIXL DAC L1 Switch' on"
cset "name='Stereo DAC MIXR DAC R1 Switch' on"
cset "name='Stereo DAC MIXL DAC L2 Switch' on"
cset "name='Stereo DAC MIXR DAC R2 Switch' on"
cset "name='OUT MIXL DAC L1 Switch' on"
cset "name='OUT MIXR DAC R1 Switch' on"
cset "name='SPK MIXL DAC L1 Switch' on"
cset "name='SPK MIXR DAC R1 Switch' on"
# uncomment to enable swap between AIF1 and AIF2
# warning: can only work with SSP0 firmware enabled
cset "name='SDI select' 0"
cset "name='DAI select' 0"
#cset "name='SDI select' 1"
#cset "name='DAI select' 1"
cset "name='DAC2 Playback Switch' on"
# Input Configuration
cset "name='Stereo ADC1 Mux' ADC"
cset "name='Stereo ADC2 Mux' DMIC1"
cset "name='ADC Capture Switch' on"
cset "name='Mono ADC L1 Mux' ADCL"
cset "name='Mono ADC R1 Mux' ADCR"
cset "name='Mono ADC L2 Mux' DMIC L1"
cset "name='Mono ADC R2 Mux' DMIC R1"
cset "name='Mono ADC Capture Switch' on"
# The second 'Mono ADC' path does not have a 'Boost Gain',
# set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal.
cset "name='ADC Boost Gain' 0"
# Set IN1/IN3 internal mic boost to 8 (max)
# Set IN2 headset-mic boost to 1, headset mics are quite loud
cset "name='IN1 Boost' 8"
cset "name='IN2 Boost' 1"
# cset "name='IN3 Boost' 8"
# Start with all controls which are used by the individual
# input/output Enable/DisableSequences off
cset "name='RECMIXL BST1 Switch' off"
cset "name='RECMIXR BST1 Switch' off"
cset "name='RECMIXL BST2 Switch' off"
cset "name='RECMIXR BST2 Switch' off"
cset "name='RECMIXL BST3 Switch' off"
cset "name='RECMIXR BST3 Switch' off"
cset "name='Stereo ADC MIXL ADC1 Switch' off"
cset "name='Stereo ADC MIXR ADC1 Switch' off"
cset "name='Stereo ADC MIXL ADC2 Switch' off"
cset "name='Stereo ADC MIXR ADC2 Switch' off"
cset "name='Mono ADC MIXL ADC1 Switch' off"
cset "name='Mono ADC MIXR ADC1 Switch' off"
cset "name='Mono ADC MIXL ADC2 Switch' off"
cset "name='Mono ADC MIXR ADC2 Switch' off"
# Turn off playback switches by default, otherwise both Speaker
# and headphones are playing audio initially until headphones are
# re-inserted.
cset "name='HP L Playback Switch' off"
cset "name='HP R Playback Switch' off"
cset "name='Speaker L Playback Switch' off"
cset "name='Speaker R Playback Switch' off"
### PinePhonePro specific configuration ###
# Set capture volume to 0dB so modem audio doesn't overdrive the ADC
cset "name='ADC Capture Volume' 47"
cset "name='Mono ADC Capture Volume' 47"
# Modem audio is line level, no need to boost this signal
cset "name='IN3 Boost' 0"
# MONO output is used as IN3 here, so make sure it's disabled
cset "name='Mono Playback Switch' off"
# Set playback volumes to 0dB
cset "name='HP Playback Volume' 31"
cset "name='Speaker Playback Volume' 31"
# Limit amplification factor of earpiece amplifier so sound stays clear
cset "name='Class D SPK Ratio Control' 1.66x"
]
DisableSequence [
# Reset output routing
cset "name='DAC MIXL INF1 Switch' off"
cset "name='DAC MIXR INF1 Switch' off"
cset "name='OUT MIXL DAC L1 Switch' off"
cset "name='OUT MIXR DAC R1 Switch' off"
cset "name='SPK MIXL DAC L1 Switch' off"
cset "name='SPK MIXR DAC R1 Switch' off"
]
Value {
TQ "HiFi"
}
}
SectionDevice."Earpiece" {
Comment "Internal Earpiece"
ConflictingDevice [
"Speaker"
]
EnableSequence [
cset "name='SPOL MIX SPKVOL L Switch' on"
# for mono speaker we apply left on right
# cset "name='SPOR MIX SPKVOL R Switch' on"
cset "name='SPOL MIX SPKVOL R Switch' on"
cset "name='Speaker Channel Switch' on"
cset "name='Speaker L Playback Switch' on"
cset "name='Speaker R Playback Switch' on"
]
DisableSequence [
cset "name='Speaker Channel Switch' off"
cset "name='Speaker L Playback Switch' off"
cset "name='Speaker R Playback Switch' off"
]
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
PlaybackMixerElem "Speaker"
PlaybackVolume "Speaker Playback Volume"
PlaybackMasterElem "DAC1"
}
}
SectionDevice."Speaker" {
Comment "Internal Speaker"
ConflictingDevice [
"Earpiece"
]
EnableSequence [
cset "name='HPO MIX HPVOL Switch' on"
cset "name='HP Channel Switch' on"
cset "name='HP L Playback Switch' on"
cset "name='HP R Playback Switch' on"
]
DisableSequence [
cset "name='HP Channel Switch' off"
cset "name='HP L Playback Switch' off"
cset "name='HP R Playback Switch' off"
]
Value {
PlaybackPriority 300
PlaybackPCM "hw:${CardId}"
JackControl "Headphone Jack"
PlaybackMixerElem "HP"
PlaybackVolume "HP Playback Volume"
PlaybackMasterElem "DAC1"
}
}
SectionDevice."DigitalMic" {
Comment "Internal Microphone"
EnableSequence [
cset "name='Mono ADC MIXL ADC2 Switch' on"
cset "name='Mono ADC MIXR ADC2 Switch' on"
cset "name='Stereo ADC MIXL ADC2 Switch' on"
cset "name='Stereo ADC MIXR ADC2 Switch' on"
]
DisableSequence [
cset "name='Mono ADC MIXL ADC2 Switch' off"
cset "name='Mono ADC MIXR ADC2 Switch' off"
cset "name='Stereo ADC MIXL ADC2 Switch' off"
cset "name='Stereo ADC MIXR ADC2 Switch' off"
]
Value {
CapturePriority 200
CapturePCM "hw:${CardId}"
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "ADC Capture Switch"
}
}

View file

@ -1,16 +0,0 @@
Syntax 4
Comment "PinePhone Pro"
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Default"
}
SectionUseCase."VoiceCall" {
File "VoiceCall.conf"
Comment "Phone call"
}
Include.card-init.File "/lib/card-init.conf"
Include.ctl-remap.File "/lib/ctl-remap.conf"
Include.codec-init.File "/codecs/rt5640/init.conf"

View file

@ -1,233 +0,0 @@
SectionVerb {
EnableSequence [
### Default rt5640 configuration, copied from /codecs/rt5640/EnableSeq.conf ###
# RT5640 default output routing
# cset "name='DAC MIXL INF1 Switch' on"
# cset "name='DAC MIXR INF1 Switch' on"
cset "name='Stereo DAC MIXL DAC L1 Switch' on"
cset "name='Stereo DAC MIXR DAC R1 Switch' on"
cset "name='Stereo DAC MIXL DAC L2 Switch' on"
cset "name='Stereo DAC MIXR DAC R2 Switch' on"
# cset "name='OUT MIXL DAC L1 Switch' on"
# cset "name='OUT MIXR DAC R1 Switch' on"
# cset "name='SPK MIXL DAC L1 Switch' on"
# cset "name='SPK MIXR DAC R1 Switch' on"
# uncomment to enable swap between AIF1 and AIF2
# warning: can only work with SSP0 firmware enabled
cset "name='SDI select' 0"
cset "name='DAI select' 0"
#cset "name='SDI select' 1"
#cset "name='DAI select' 1"
cset "name='DAC2 Playback Switch' on"
# Input Configuration
cset "name='Stereo ADC1 Mux' ADC"
cset "name='Stereo ADC2 Mux' DMIC1"
cset "name='ADC Capture Switch' on"
cset "name='Mono ADC L1 Mux' ADCL"
cset "name='Mono ADC R1 Mux' ADCR"
cset "name='Mono ADC L2 Mux' DMIC L1"
cset "name='Mono ADC R2 Mux' DMIC R1"
cset "name='Mono ADC Capture Switch' on"
# The second 'Mono ADC' path does not have a 'Boost Gain',
# set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal.
cset "name='ADC Boost Gain' 0"
# Set IN1/IN3 internal mic boost to 8 (max)
# Set IN2 headset-mic boost to 1, headset mics are quite loud
cset "name='IN1 Boost' 8"
cset "name='IN2 Boost' 1"
# cset "name='IN3 Boost' 8"
# Start with all controls which are used by the individual
# input/output Enable/DisableSequences off
cset "name='RECMIXL BST1 Switch' off"
cset "name='RECMIXR BST1 Switch' off"
# cset "name='RECMIXL BST2 Switch' off"
cset "name='RECMIXR BST2 Switch' off"
cset "name='RECMIXL BST3 Switch' off"
# cset "name='RECMIXR BST3 Switch' off"
cset "name='Stereo ADC MIXL ADC1 Switch' off"
cset "name='Stereo ADC MIXR ADC1 Switch' off"
cset "name='Stereo ADC MIXL ADC2 Switch' off"
cset "name='Stereo ADC MIXR ADC2 Switch' off"
cset "name='Mono ADC MIXL ADC1 Switch' off"
cset "name='Mono ADC MIXR ADC1 Switch' off"
cset "name='Mono ADC MIXL ADC2 Switch' off"
cset "name='Mono ADC MIXR ADC2 Switch' off"
# Turn off playback switches by default, otherwise both Speaker
# and headphones are playing audio initially until headphones are
# re-inserted.
cset "name='HP L Playback Switch' off"
cset "name='HP R Playback Switch' off"
cset "name='Speaker L Playback Switch' off"
cset "name='Speaker R Playback Switch' off"
### PinePhonePro specific configuration ###
# Get audio only from the microphones, not the system
cset "name='DAC MIXL INF1 Switch' off"
cset "name='DAC MIXR INF1 Switch' off"
cset "name='DAC MIXL Stereo ADC Switch' on"
cset "name='DAC MIXR Stereo ADC Switch' on"
# Route headset mic to the left channel and modem audio
# to the right channel
cset "name='RECMIXL BST2 Switch' on"
cset "name='RECMIXR BST3 Switch' on"
# Set capture volume to 0dB so modem audio doesn't overdrive the ADC
cset "name='ADC Capture Volume' 47"
cset "name='Mono ADC Capture Volume' 47"
# Modem audio is line level, no need to boost this signal
cset "name='IN3 Boost' 0"
# MONO output is used as IN3 here, so make sure it's disabled
cset "name='Mono Playback Switch' off"
# Set playback volumes to 0dB
cset "name='HP Playback Volume' 31"
cset "name='Speaker Playback Volume' 31"
# Limit amplification factor of earpiece amplifier so sound stays clear
cset "name='Class D SPK Ratio Control' 1.66x"
# Loopback IN3 to earpiece/speaker/headphones
cset "name='OUT MIXR REC MIXR Switch' on"
cset "name='SPK MIXR OUT MIXR Switch' on"
# Send the left channel (microphones) to the modem through DAC L1
cset "name='LOUT MIX DAC L1 Switch' on"
# Don't use DAC R1 nor the OUTVOL blocks as we use them for
# routing audio from the modem
cset "name='LOUT MIX DAC R1 Switch' off"
cset "name='LOUT MIX OUTVOL L Switch' off"
cset "name='LOUT MIX OUTVOL R Switch' off"
# Disable left channel for SPK (earpiece) and HP (speaker/headphones)
# outputs as we're only routing modem audio to the right channel
cset "name='SPOL MIX SPKVOL L Switch' off"
cset "name='HP L Playback Switch' off"
]
DisableSequence [
# Reset output routing
cset "name='DAC MIXL Stereo ADC Switch' off"
cset "name='DAC MIXR Stereo ADC Switch' off"
cset "name='OUT MIXR REC MIXR Switch' off"
cset "name='SPK MIXR OUT MIXR Switch' off"
cset "name='LOUT MIX DAC L1 Switch' off"
# Reset ADC input routing
cset "name='RECMIXL BST2 Switch' off"
cset "name='RECMIXR BST3 Switch' off"
]
Value {
TQ "VoiceCall"
}
}
SectionDevice."Earpiece" {
Comment "Internal Earpiece"
ConflictingDevice [
"Speaker"
]
EnableSequence [
# Send right channel to left as it's mono only
cset "name='SPOL MIX SPKVOL R Switch' on"
cset "name='Speaker Channel Switch' on"
cset "name='Speaker L Playback Switch' on"
]
DisableSequence [
cset "name='Speaker Channel Switch' off"
cset "name='Speaker L Playback Switch' off"
]
Value {
PlaybackPriority 300
PlaybackPCM "hw:${CardId}"
PlaybackMixerElem "Speaker"
PlaybackVolume "Speaker Playback Volume"
PlaybackMasterElem "DAC1"
}
}
SectionDevice."Speaker" {
Comment "Internal Speaker"
ConflictingDevice [
"Earpiece"
]
EnableSequence [
cset "name='HPO MIX HPVOL Switch' on"
cset "name='HP Channel Switch' on"
cset "name='HP R Playback Switch' on"
]
DisableSequence [
cset "name='HP Channel Switch' off"
cset "name='HP R Playback Switch' off"
]
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
JackControl "Headphone Jack"
PlaybackMixerElem "HP"
PlaybackVolume "HP Playback Volume"
PlaybackMasterElem "DAC1"
}
}
SectionDevice."DigitalMic" {
Comment "Internal Microphone"
EnableSequence [
cset "name='Stereo ADC MIXL ADC2 Switch' on"
]
DisableSequence [
cset "name='Stereo ADC MIXL ADC2 Switch' off"
]
Value {
CapturePriority 200
CapturePCM "hw:${CardId}"
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "ADC Capture Switch"
}
}
SectionDevice."HeadsetMic" {
Comment "Headset Microphone"
EnableSequence [
cset "name='Stereo ADC MIXL ADC1 Switch' on"
]
DisableSequence [
cset "name='Stereo ADC MIXL ADC1 Switch' off"
]
Value {
CapturePriority 100
CapturePCM "hw:${CardId}"
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "ADC Capture Switch"
}
}

View file

@ -1,82 +0,0 @@
# Maintainer: Martijn Braam <martijn@brixit.nl>
pkgname=linux-pine64-pinephonepro
pkgver=5.16.7
pkgrel=1
pkgdesc="Mainline kernel for the pinephone pro"
arch="aarch64"
_flavor="${pkgname#linux-}"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-anbox
pmb:kconfigcheck-nftables
pmb:kconfigcheck-containers
pmb:kconfigcheck-zram
"
makedepends="
bison
findutils
flex
gmp-dev
gzip
linux-headers
mpc1-dev
mpfr-dev
openssl-dev
perl
postmarketos-installkernel
rsync
xz
"
case "$CARCH" in
aarch64*) _carch="arm64" ;;
arm*) _carch="arm" ;;
esac
# Source
_config="config-$_flavor.$CARCH"
case $pkgver in
*.*.*) _kernver=${pkgver%.0};;
*.*) _kernver=$pkgver;;
esac
_commit="138b2bb2032e6df014efe88e4a4bbdd4ad93b18d"
source="
https://gitlab.com/pine64-org/linux/-/archive/ppp-$pkgver/linux-ppp-$pkgver.tar.gz
config-$_flavor.aarch64
"
builddir="$srcdir/linux-ppp-$pkgver"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$CARCH" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))"
}
package() {
mkdir -p "$pkgdir"/boot
make zinstall modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs-$_flavor
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
365697049c59f2d0baf27becd6d00da030ab931b16ef075ca9a227302adf741de55137a349d589edd8bd028f95f6e23417858cfefb9d9748ec5e36fc3b4205de linux-ppp-5.16.7.tar.gz
786b64241a720e7f174ccde3c04fc5c53b0b26858bfd654ac387c84b9398cb4e235f33b0e6d6a0173e6c208d1b5e1deb610d0f5d6645a82878c19e1ee81860dc config-pine64-pinephonepro.aarch64
"