Verified Commit 1e5e2224 authored by ✙ jenneron ✙'s avatar ✙ jenneron ✙ Committed by Alexey Min
Browse files

google-peach-pit: new device (MR 2888)

parent f38eb4b8
Pipeline #489357585 passed with stages
in 134 minutes and 53 seconds
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-peach-pit
pkgdesc="Samsung Chromebook 2 (11.6 inch)"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
alsa-ucm-conf
mesa-dri-gallium
postmarketos-base
linux-postmarketos-exynos5
u-boot-peach-pit
"
makedepends="
devicepkg-dev
u-boot-tools
"
source="
deviceinfo
i3wm/xorg.conf.d/90-tap-to-click.conf
modprobe.d/mali.conf
uboot-script.cmd
ucm/Peach-Pit-I2S-MAX98090.conf
ucm/HiFi.conf
mpv/mpv.conf.wayland
mpv/mpv.conf.xorg
sway/tinydm/10-no-hardware-cursor.sh
"
subpackages="
$pkgname-i3wm
$pkgname-mpv-wayland:mpv_wayland
$pkgname-mpv-xorg:mpv_xorg
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-sway
"
build() {
devicepkg_build $startdir $pkgname
mkimage \
-A arm \
-O linux \
-T script \
-C none \
-a 0 \
-e 0 \
-n postmarketos \
-d "$srcdir"/uboot-script.cmd \
"$srcdir"/boot.scr
}
package() {
devicepkg_package $startdir $pkgname
# Block panfrost probe as it causes segfault in X11
install -Dm644 "$srcdir"/mali.conf \
"$pkgdir"/etc/modprobe.d/mali.conf
# Alsa UCM configs
install -Dm644 "$srcdir"/Peach-Pit-I2S-MAX98090.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/Peach-Pit-I2S-MAX98090/Peach-Pit-I2S-MAX98090.conf
install -Dm644 "$srcdir"/HiFi.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/Peach-Pit-I2S-MAX98090/HiFi.conf
ln -s /usr/share/alsa/ucm2/conf.d/Peach-Pit-I2S-MAX98090 \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/Peach-Pit-I2S-M
# U-Boot script
install -Dm644 "$srcdir"/boot.scr \
"$pkgdir"/boot/boot.scr
}
i3wm() {
install_if="$pkgname=$pkgver-r$pkgrel postmarketos-ui-i3wm"
install -Dm644 "$srcdir"/90-tap-to-click.conf \
"$subpkgdir"/etc/X11/xorg.conf.d/90-tap-to-click.conf
}
mpv_wayland() {
# Looks like wayland libs are installed with some x11 UIs too, so match wlroots here
install_if="$pkgname=$pkgver-r$pkgrel mpv wlroots"
install -Dm644 "$srcdir"/mpv.conf.wayland \
"$subpkgdir"/etc/mpv/mpv.conf
}
mpv_xorg() {
install_if="$pkgname=$pkgver-r$pkgrel mpv xorg-server"
install -Dm644 "$srcdir"/mpv.conf.xorg \
"$subpkgdir"/etc/mpv/mpv.conf
}
nonfree_firmware() {
pkgdesc="WiFi/BT firmware"
depends="linux-firmware-mrvl"
mkdir "$subpkgdir"
}
sway() {
install_if="$pkgname=$pkgver-r$pkgrel postmarketos-ui-sway"
install -Dm755 "$srcdir"/10-no-hardware-cursor.sh \
"$subpkgdir"/etc/tinydm.d/env-wayland.d/10-no-hardware-cursor.sh
}
sha512sums="
bf802eb8fde5f6b4b0d052ac70f9c5f813a84c24642435168f0aa01511b916c068404087439f4960d570c6d0a1c87949bb87bb733fe2e1b1646d6c84dfe1fcd1 deviceinfo
e53ca475830930ecfc1fd537702e850e2abcb66fbed521cb6c3a2918d762649254bd0244ec93a47b20dfc593ec3afc9bdebdec1759a7bc96dcbe4800f40893da 90-tap-to-click.conf
c5fdd5a39a41044343d937a1ad31cc6bb893f19a329beb4ce09249064cac066d643c84ffcbfcd794113c228c5a56e28c82812092751546b49ab31142dc8245b1 mali.conf
7c59bbec6b54d4a96d7e80468a49f1ccb7e4ec216c6a598a0f2fe3bc5b0aea19640eeb311a25d5ac4532ff85ed98a8612f22a02e723d089940da8efdbbd047f0 uboot-script.cmd
6fe67c8f2e09e3e37297eebaf2a86a32671923a5fd4d18e5aeb10e580fb998e4ddb4a691531a0c8f4b4e70c6f0f7e91008dd836ffca8026d59862c6e829fd996 Peach-Pit-I2S-MAX98090.conf
194b6169168b40592cf1e6b5f3b21aaa24a602869d7aec358cd5e1f06de34e9b0fe3da094e438ef2d3ab5be80275e6c0b6afe7ce92e2365a70e8b5a21a873234 HiFi.conf
8f9dc3c7caeab6c5321dc2bf498f1a03a793f23cb776763316bc356b9d433d7a3337e61154069464dcda200bf390b99f3be8f657a40c6d2f6be3cbc6fb751080 mpv.conf.wayland
d6bc39df48ba0e985a796426039205335adf1c91b9c150b05a4239339fc78b1748b3a83c699de69e9a5829f29573a323f40788da58ed15b1951de1eab7e31c3d mpv.conf.xorg
78e566bf3a597b9b5f73f686feb93ae61d1bed350366428d74c7735f1f82ab390f47ba9deb9d21e8dfcee251dc6178956838ca1b34838bb0a7d740be0e2c8330 10-no-hardware-cursor.sh
"
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Samsung Chromebook 2 11.6\""
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="google-peach-pit"
deviceinfo_year="2014"
deviceinfo_dtb="exynos5420-peach-pit"
deviceinfo_modules_initfs="drm-dp-aux-bus panel-edp drm-kms-helper cros-ec-keyb sbs-battery tps65090-charger"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="laptop"
deviceinfo_keyboard="true"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1366"
deviceinfo_screen_height="768"
# DRM is available, so all UIs can work with software rendering
deviceinfo_gpu_accelerated="true"
# Bootloader related
deviceinfo_flash_method="none"
deviceinfo_cgpt_kpart="/usr/share/u-boot/google-peach-pit/u-boot-dtb.img.kpart"
deviceinfo_cgpt_kpart_start="8192"
deviceinfo_cgpt_kpart_size="32768"
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
Driver "libinput"
Option "Tapping" "on"
EndSection
vo=wlshm
profile=sw-fast
ytdl-format="bestvideo[height<=?720]+bestaudio/best"
vo=x11
profile=sw-fast
ytdl-format="bestvideo[height<=?720]+bestaudio/best"
#!/bin/bash
# A workaround for missing cursor issue
export WLR_NO_HARDWARE_CURSORS=1
if test ${devnum} -eq 2 ; then
echo "Booting from SD";
setenv pmos_boot_dev 1;
else
echo "Booting from eMMC";
setenv pmos_boot_dev 0;
fi;
setenv bootargs console=null mem=3523M pmos_boot=/dev/mmcblk${pmos_boot_dev}p2 pmos_root=/dev/mmcblk${pmos_boot_dev}p3
echo Loading DTB
load mmc ${devnum}:2 ${fdt_addr_r} exynos5420-peach-pit.dtb
echo Loading Initramfs
load mmc ${devnum}:2 ${ramdisk_addr_r} initramfs
setenv ramdisk_size ${filesize}
echo Loading Kernel
load mmc ${devnum}:2 ${kernel_addr_r} vmlinuz
echo Resizing FDT
fdt addr ${fdt_addr_r}
fdt resize
echo Booting Kernel
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${ramdisk_size} ${fdt_addr_r}
SectionVerb {
Value {
OutputDspName "speaker_eq"
}
EnableSequence [
cdev "hw:PeachPitI2SMAX9"
cset "name='Left Speaker Mixer Left DAC Switch' on"
cset "name='Right Speaker Mixer Right DAC Switch' on"
cset "name='Digital EQ 3 Band Switch' off"
cset "name='Digital EQ 5 Band Switch' off"
cset "name='Digital EQ 7 Band Switch' off"
cset "name='Biquad Switch' off"
cset "name='Filter Mode' Music"
cset "name='ADC Oversampling Rate' 0"
cset "name='MIC2 Mux' IN34"
cset "name='DMIC Mux' DMIC"
cset "name='Left ADC Mixer MIC2 Switch' on"
cset "name='Right ADC Mixer MIC2 Switch' on"
cset "name='ADCR Boost Volume' 4"
cset "name='ADCL Boost Volume' 4"
cset "name='ADCR Volume' 11"
cset "name='ADCL Volume' 11"
cset "name='Speaker Left Mixer Volume' 2"
cset "name='Speaker Right Mixer Volume' 2"
cset "name='Record Path DC Blocking' on"
cset "name='Playback Path DC Blocking' on"
cset "name='Speaker Left Switch' off"
cset "name='Speaker Right Switch' off"
cset "name='Headphone Left Switch' off"
cset "name='Headphone Right Switch' off"
]
DisableSequence [
]
}
SectionDevice."Speakers" {
Comment "Speakers"
ConflictingDevice [
"Headphones"
]
EnableSequence [
cset "name='Speaker Left Switch' on"
cset "name='Speaker Right Switch' on"
]
DisableSequence [
cset "name='Speaker Left Switch' off"
cset "name='Speaker Right Switch' off"
]
Value {
PlaybackPCM "hw:${CardId}"
PlaybackChannels 2
PlaybackVolume "Speaker Volume"
}
}
SectionDevice."Headphones" {
Comment "Headphones"
ConflictingDevice [
"Speakers"
]
EnableSequence [
cset "name='Headphone Left Switch' on"
cset "name='Headphone Right Switch' on"
]
DisableSequence [
cset "name='Headphone Left Switch' off"
cset "name='Headphone Right Switch' off"
]
Value {
JackControl "Headphone Jack"
PlaybackPCM "hw:${CardId}"
PlaybackChannels 2
PlaybackVolume "Headphone Volume"
}
}
SectionDevice."InternalMicrophone" {
Comment "Internal Microphone"
ConflictingDevice [
"HeadsetMicrophone"
]
EnableSequence [
cset "name='DMIC Mux' DMIC"
]
DisableSequence [
cset "name='DMIC Mux' ADC"
]
Value {
CapturePCM "hw:${CardId}"
CaptureChannels 2
CaptureVolume "MIC2 Volume"
DefaultNodeGain "-500"
}
}
SectionDevice."HeadsetMicrophone" {
Comment "Headset Microphone"
ConflictingDevice [
"InternalMicrophone"
]
EnableSequence [
cset "name='DMIC Mux' ADC"
]
DisableSequence [
cset "name='DMIC Mux' DMIC"
]
Value {
JackControl "Mic Jack"
CapturePCM "hw:${CardId}"
CaptureChannels 2
CaptureVolume "MIC2 Volume"
DefaultNodeGain "-500"
}
}
Syntax 2
Comment "Google Peach Pit internal card (Maxim 98090)"
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Default"
}
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=u-boot-peach-pit
pkgver=2022.01
pkgrel=0
pkgdesc="u-boot for Google Peach Pit chromebooks"
url="https://www.denx.de/wiki/U-Boot/"
arch="armv7"
license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs
ISC LGPL-2.0-only LGPL-2.1-only X11"
options="!check" # no tests in upstream
makedepends="$depends_dev bc dtc python3-dev swig bison flex openssl-dev
py3-setuptools linux-headers u-boot-tools vboot-utils"
source="
https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
cve-2017-5715.patch
"
builddir="$srcdir"/u-boot-${pkgver//_/-}
prepare() {
default_prepare
}
build() {
make peach-pit_defconfig
make
mkimage -A arm -O linux -T kernel -C none -e 0x23E00000 -a 0x23E00000 -d u-boot-dtb.bin u-boot-dtb.img
echo -e "\n" > dummy_config
echo -e "\n" > dummy_bootloader
vbutil_kernel \
--pack u-boot-dtb.img.kpart \
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--version 1 \
--arch arm \
--config dummy_config \
--bootloader dummy_bootloader \
--vmlinuz u-boot-dtb.img
}
package() {
install -D -m644 "$builddir"/u-boot-dtb.img.kpart \
"$pkgdir"/usr/share/u-boot/google-peach-pit/u-boot-dtb.img.kpart
}
sha512sums="
d83c62bd8f0f51664d2aca329a3ce1379cfd1dfff439dccd6cfc2cb33cfef89a2b01855c97716f591b5550bfdf99e2f3aef7efa33f2e7834c820648f9eef3825 u-boot-2022.01.tar.bz2
fa9415ef5feeb7045eea6975f61517face339f0c9173fe5717e38eadefb806cb98183473bd38ace496b0d2677af50ad13bc98d221925803640d97b6e744fa065 cve-2017-5715.patch
"
From: jenneron <jenneron@protonmail.com>
diff --git a/configs/peach-pit_defconfig b/configs/peach-pit_defconfig
index 4259f1416e..9e1d23a8ce 100644
--- a/configs/peach-pit_defconfig
+++ b/configs/peach-pit_defconfig
@@ -83,3 +83,4 @@ CONFIG_VIDEO_BRIDGE_PARADE_PS862X=y
CONFIG_LCD=y
CONFIG_TPM=y
CONFIG_ERRNO_STR=y
+CONFIG_ARM_CORTEX_A15_CVE_2017_5715=y
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment