From 7e6351e0862fe0797cd8fa9415bf79e27c81adeb Mon Sep 17 00:00:00 2001 From: blacksilver Date: Tue, 8 Feb 2022 21:26:59 +0100 Subject: [PATCH] samsung-manta: charging, firmware, wifi, alsa, framebuffer (MR 2892) [ci:skip-build] already built successfully in CI --- .../100-manta-charging.rules | 4 + device/testing/device-samsung-manta/APKBUILD | 69 +++++++- .../autodetect-charger.sh | 2 + .../testing/device-samsung-manta/deviceinfo | 2 +- .../led-charging-manta.sh | 3 + .../led-discharging-manta.sh | 3 + .../device-samsung-manta/modules-load.conf | 5 + .../device-samsung-manta/networkmanager.conf | 2 + .../testing/device-samsung-manta/pointercal | 1 + .../device-samsung-manta/sink-usb-power.sh | 2 + .../device-samsung-manta/ucm/HiFi.conf | 152 ++++++++++++++++++ .../device-samsung-manta/ucm/Manta-I2S.conf | 51 ++++++ .../device-samsung-manta/ucm/Manta-SPDIF.conf | 5 + .../device-samsung-manta/ucm/SPDIF.conf | 2 + .../testing/firmware-samsung-manta/APKBUILD | 42 +++++ .../firmware-samsung-manta.post-install | 10 ++ .../01-fix-video-argb-setting.patch | 18 +++ device/testing/linux-samsung-manta/APKBUILD | 39 +++-- .../config-samsung-manta.armv7 | 31 +++- ...cc10-extern_YYLOC_global_declaration.patch | 1 + ...give-up-on-ilog2-const-optimizations.patch | 1 + .../gcc8-fix-put-user.patch | 1 + 22 files changed, 419 insertions(+), 27 deletions(-) create mode 100644 device/testing/device-samsung-manta/100-manta-charging.rules create mode 100644 device/testing/device-samsung-manta/autodetect-charger.sh create mode 100644 device/testing/device-samsung-manta/led-charging-manta.sh create mode 100644 device/testing/device-samsung-manta/led-discharging-manta.sh create mode 100644 device/testing/device-samsung-manta/modules-load.conf create mode 100644 device/testing/device-samsung-manta/networkmanager.conf create mode 100644 device/testing/device-samsung-manta/pointercal create mode 100644 device/testing/device-samsung-manta/sink-usb-power.sh create mode 100644 device/testing/device-samsung-manta/ucm/HiFi.conf create mode 100644 device/testing/device-samsung-manta/ucm/Manta-I2S.conf create mode 100644 device/testing/device-samsung-manta/ucm/Manta-SPDIF.conf create mode 100644 device/testing/device-samsung-manta/ucm/SPDIF.conf create mode 100644 device/testing/firmware-samsung-manta/APKBUILD create mode 100644 device/testing/firmware-samsung-manta/firmware-samsung-manta.post-install create mode 100644 device/testing/linux-samsung-manta/01-fix-video-argb-setting.patch create mode 120000 device/testing/linux-samsung-manta/gcc10-extern_YYLOC_global_declaration.patch create mode 120000 device/testing/linux-samsung-manta/gcc7-give-up-on-ilog2-const-optimizations.patch create mode 120000 device/testing/linux-samsung-manta/gcc8-fix-put-user.patch diff --git a/device/testing/device-samsung-manta/100-manta-charging.rules b/device/testing/device-samsung-manta/100-manta-charging.rules new file mode 100644 index 000000000..7b0073897 --- /dev/null +++ b/device/testing/device-samsung-manta/100-manta-charging.rules @@ -0,0 +1,4 @@ +SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_REMOTE_TYPE}=="USB_DCP", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/lib/device-samsung-manta/autodetect-charger.sh" +SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_REMOTE_TYPE}=="USB", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/lib/device-samsung-manta/sink-usb-power.sh" +SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_STATUS}=="Charging", RUN+="/usr/lib/device-samsung-manta/led-charging-manta.sh" +SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_STATUS}=="Discharging", RUN+="/usr/lib/device-samsung-manta/led-discharging-manta.sh" diff --git a/device/testing/device-samsung-manta/APKBUILD b/device/testing/device-samsung-manta/APKBUILD index d202068e4..9993b9cc7 100644 --- a/device/testing/device-samsung-manta/APKBUILD +++ b/device/testing/device-samsung-manta/APKBUILD @@ -1,15 +1,30 @@ # Reference: pkgname=device-samsung-manta pkgdesc="Google Nexus 10" -pkgver=0.4 -pkgrel=2 +pkgver=0.5 +pkgrel=0 url="https://postmarketos.org" license="MIT" arch="armv7" options="!check !archcheck" -depends="postmarketos-base linux-samsung-manta mkbootimg mesa-dri-swrast watchdog-kick" +depends="postmarketos-base linux-samsung-manta mkbootimg mesa-dri-gallium watchdog-kick alsa-ucm-conf" makedepends="devicepkg-dev" -source="deviceinfo" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" +source=" + deviceinfo + pointercal + modules-load.conf + 100-manta-charging.rules + autodetect-charger.sh + sink-usb-power.sh + led-charging-manta.sh + led-discharging-manta.sh + networkmanager.conf + ucm/Manta-I2S.conf + ucm/HiFi.conf + ucm/Manta-SPDIF.conf + ucm/SPDIF.conf +" build() { devicepkg_build $startdir $pkgname @@ -17,8 +32,52 @@ build() { package() { devicepkg_package $startdir $pkgname + + install -D -m644 "$srcdir"/networkmanager.conf \ + "$pkgdir"/etc/NetworkManager/conf.d/10-manta.conf + + install -Dm744 "$srcdir"/autodetect-charger.sh \ + "$pkgdir"/usr/lib/device-samsung-manta/autodetect-charger.sh + install -Dm744 "$srcdir"/sink-usb-power.sh \ + "$pkgdir"/usr/lib/device-samsung-manta/sink-usb-power.sh + install -Dm744 "$srcdir"/led-charging-manta.sh \ + "$pkgdir"/usr/lib/device-samsung-manta/led-charging-manta.sh + install -Dm744 "$srcdir"/led-discharging-manta.sh \ + "$pkgdir"/usr/lib/device-samsung-manta/led-discharging-manta.sh + + install -Dm644 "$srcdir"/100-manta-charging.rules \ + "$pkgdir"/usr/lib/udev/rules.d/100-manta-charging.rules + + install -D -m644 "$srcdir"/pointercal \ + "$pkgdir"/etc/pointercal + + install -Dm644 -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/Manta-I2S \ + "$srcdir"/Manta-I2S.conf \ + "$srcdir"/HiFi.conf + + install -Dm644 -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/Manta-SPDIF \ + "$srcdir"/Manta-SPDIF.conf \ + "$srcdir"/SPDIF.conf +} + +nonfree_firmware() { + pkgdesc="Firmware for Samsung Manta (Nexus 10)" + depends="firmware-samsung-manta" + mkdir "$subpkgdir" } sha512sums=" -98c474bd11150036f18701eaedb72f1038e2318caebd2f9d48ec1ab6d1fd47ccb3d49fff002c25a499f97cee59dd09b206c068bfcf642155a224422b233a37f4 deviceinfo +58a40f3ea8942e868d384f185e3bfadb3b1b1d1d3b785425ccc2fd851189595b6c645edda9aad1e158abcd2ead0e169470e43392d2263742e36d7f4fac5cb0e9 deviceinfo +4a4a1e478131175d628669c45c780db6eace39653d7c331e13042d315a1d04a1feebbf3ab1caea959f84d3203dcf0402da0a51dfd90728bc0a2a52a069069c52 pointercal +aa65eddbf733af7a8c143f810aa21319ea267bfe473080faba634419146ff14f57e9e07cecdf64aefe0d060bf03564637d606be7b436ccb7de512697097460d5 modules-load.conf +e479dd64f2c27aeeafcc57ea1ae650b382e07a7ea2addf994406b2f64e9b3eff7df451637ceeef85e484be39a8d5a19e35d35c2643b9538b29abf55c67bcecc3 100-manta-charging.rules +edb46f0de37835c7c5a55f47f57acd40012817e0a734153d49033d7aa82404192abdd8f100c93df80702a09698e0d13eb3e26f4bcc86dc427322a2b68498bbb4 autodetect-charger.sh +71a4bf6d25b55acb94fd624625c94cc9c74fe57c4328cddb488f57274443f8c9354c0a5a6f52df40f0ca54ed0713db73f1f90b5fcfd0f8e25ed9cc755b30dea3 sink-usb-power.sh +797f5dce8e27bb5e1fb77a6fa9a917847067f533f14b7b6339703f0aa2969cd8bee686fcdd83e91d21c2fefb6d44365f6b5b0c7726950febfee8a99f9faf8be7 led-charging-manta.sh +a6c9ac55b8d343bcef8765498b450d3e17993b7ad72b274c2fe3e9d3b1a94f917f3790a3595394c0a4de5f1debffbcfbfccd1e4eb637604d6a3da54741cf6091 led-discharging-manta.sh +a6d59c86fc7c47ba25fe125fe57cfbc0b82cb41e3729c3b0387e611386c2e449fa14360b999bc7593527f30a01f3f85bacf2d81762f167a547b37271456343bd networkmanager.conf +20bd1a5ced8f816c931353abb939936f3c71c5ae1e7a6736dc7c596e721fd59dff70866dc056ef8732fa3cd68f50f08875698696f75ca15e8d618d7778342da4 Manta-I2S.conf +684f1dacb031dcbfd17d55c43db08a1da89d1e7c8197e4c9b8200096e74895469cffabeef3233a4ff380eb92e5fd5618819770ade4f86d1aad9e12e9da7ef122 HiFi.conf +d9e1847f74e46091e2c0bf6cf088cd85ad866fde3e0b8aff8fb02b2dc8869c44977303e40f2be86751ad083838c5a659dd70e434746b92bafd2d0a618f135bcb Manta-SPDIF.conf +5e1bae638cbd88a38b10b45f675bc4e5fdb84155923a945168207e49db2053a31ae9e7b5233936b832ed60b3a367e31dee7b2d85b52b2922dcfa5df1a813aaa7 SPDIF.conf " diff --git a/device/testing/device-samsung-manta/autodetect-charger.sh b/device/testing/device-samsung-manta/autodetect-charger.sh new file mode 100644 index 000000000..2604c8861 --- /dev/null +++ b/device/testing/device-samsung-manta/autodetect-charger.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo 1 > /sys/class/power_supply/smb347-usb/charger_detection diff --git a/device/testing/device-samsung-manta/deviceinfo b/device/testing/device-samsung-manta/deviceinfo index 238e5c3b8..1e4fcd8c3 100644 --- a/device/testing/device-samsung-manta/deviceinfo +++ b/device/testing/device-samsung-manta/deviceinfo @@ -27,5 +27,5 @@ deviceinfo_flash_offset_ramdisk="0x01000000" deviceinfo_flash_offset_second="0x00f00000" deviceinfo_flash_offset_tags="0x00000100" deviceinfo_flash_pagesize="2048" -deviceinfo_flash_heimdall_partition_kernel="kernel" +deviceinfo_flash_heimdall_partition_kernel="boot" deviceinfo_flash_heimdall_partition_system="system" diff --git a/device/testing/device-samsung-manta/led-charging-manta.sh b/device/testing/device-samsung-manta/led-charging-manta.sh new file mode 100644 index 000000000..81b19c114 --- /dev/null +++ b/device/testing/device-samsung-manta/led-charging-manta.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo 0xFF000000 > /sys/class/leds/as3668/color +echo 50 > /sys/class/leds/as3668/brightness diff --git a/device/testing/device-samsung-manta/led-discharging-manta.sh b/device/testing/device-samsung-manta/led-discharging-manta.sh new file mode 100644 index 000000000..57826f7d6 --- /dev/null +++ b/device/testing/device-samsung-manta/led-discharging-manta.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo 0 > /sys/class/leds/as3668/brightness +echo 0xFFFFFFFF > /sys/class/leds/as3668/color diff --git a/device/testing/device-samsung-manta/modules-load.conf b/device/testing/device-samsung-manta/modules-load.conf new file mode 100644 index 000000000..1db328bac --- /dev/null +++ b/device/testing/device-samsung-manta/modules-load.conf @@ -0,0 +1,5 @@ +# This file contains the names of kernel modules that should be loaded +# at boot time, one per line. Lines beginning with "#" are ignored. + +# touch +atmel_mxt_ts diff --git a/device/testing/device-samsung-manta/networkmanager.conf b/device/testing/device-samsung-manta/networkmanager.conf new file mode 100644 index 000000000..c777f9bf4 --- /dev/null +++ b/device/testing/device-samsung-manta/networkmanager.conf @@ -0,0 +1,2 @@ +[keyfile] +unmanaged-devices=interface-name:p2p* diff --git a/device/testing/device-samsung-manta/pointercal b/device/testing/device-samsung-manta/pointercal new file mode 100644 index 000000000..3660e9d62 --- /dev/null +++ b/device/testing/device-samsung-manta/pointercal @@ -0,0 +1 @@ +40845 31 317640 35 25267 538664 65536 2560 1600 0 \ No newline at end of file diff --git a/device/testing/device-samsung-manta/sink-usb-power.sh b/device/testing/device-samsung-manta/sink-usb-power.sh new file mode 100644 index 000000000..cee0dc16d --- /dev/null +++ b/device/testing/device-samsung-manta/sink-usb-power.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo 1 > /sys/class/power_supply/smb347-usb/usb_hc diff --git a/device/testing/device-samsung-manta/ucm/HiFi.conf b/device/testing/device-samsung-manta/ucm/HiFi.conf new file mode 100644 index 000000000..4113db309 --- /dev/null +++ b/device/testing/device-samsung-manta/ucm/HiFi.conf @@ -0,0 +1,152 @@ +SectionVerb { + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPCM "hw:MantaI2S,0" + CapturePCM "hw:MantaI2S,0" + } +} + +SectionDevice."Speaker" { + ConflictingDevice [ + "Headphones" + ] + + EnableSequence [ + cset "name='DAC1R Mixer AIF1.1 Switch' 1" + cset "name='DAC1L Mixer AIF1.1 Switch' 1" + cset "name='DAC1 Switch' 1" + cset "name='AIF1DAC1 EQ Switch' 1" + cset "name='AIF1DAC1 EQ1 Volume' 3" + cset "name='AIF1DAC1 EQ2 Volume' 8" + cset "name='AIF1DAC1 EQ3 Volume' 16" + cset "name='AIF1DAC1 EQ4 Volume' 10" + cset "name='AIF1DAC1 EQ5 Volume' 11" + cset "name='Speaker Switch' 1" + cset "name='SPKR DAC1 Switch' 1" + cset "name='SPKL DAC1 Switch' 1" + cset "name='Speaker Mixer Volume' 3" + cset "name='Speaker Boost Volume' 5" + cset "name='AIF1DRC1 Mode' Speakers Media" + cset "name='AIF1DAC1 DRC Switch' 1" + cset "name='Speaker Volume' 51" + cset "name='Speaker Volume' 52" + ] + + DisableSequence [ + cset "name='DAC1R Mixer AIF1.1 Switch' 0" + cset "name='DAC1L Mixer AIF1.1 Switch' 0" + cset "name='DAC1 Switch' 0" + cset "name='Speaker Switch' 0" + cset "name='SPKR DAC1 Switch' 0" + cset "name='SPKL DAC1 Switch' 0" + cset "name='Speaker Mixer Volume' 0" + cset "name='AIF1DRC1 Mode' Default" + cset "name='AIF1DAC1 DRC Switch' 0" + ] + + Value { + PlaybackChannels "2" + } +} + +SectionDevice."Headphones" { + ConflictingDevice [ + "Speaker" + ] + + EnableSequence [ + cset "name='DAC1R Mixer AIF1.1 Switch' 1" + cset "name='DAC1L Mixer AIF1.1 Switch' 1" + cset "name='DAC1 Switch' 1" + cset "name='AIF1DAC1 EQ Switch' 0" + cset "name='Headphone Switch' 1" + cset "name='Headphone Volume' 24" + ] + + DisableSequence [ + cset "name='DAC1R Mixer AIF1.1 Switch' 0" + cset "name='DAC1L Mixer AIF1.1 Switch' 0" + cset "name='DAC1 Switch' 0" + cset "name='Headphone Switch' 0" + ] + + Value { + PlaybackChannels "2" + } +} + +SectionDevice."Mic" { + Comment "Microphone" + + ConflictingDevice [ + "Headset" + ] + + EnableSequence [ + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1" + cset "name='MIXINR IN2R Switch' 1" + cset "name='MIXINR IN2R Volume' 1" + cset "name='IN2R Switch' 1" + cset "name='AIF1ADCL Source' Right" + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1" + cset "name='MIXINL IN2L Switch' 1" + cset "name='MIXINL IN2L Volume' 1" + cset "name='IN2L Switch' 1" + cset "name='AIF1ADCR Source' Left" + cset "name='IN2R Volume' 16" + cset "name='IN2L Volume' 16" + cset "name='AIF1ADC1 HPF Switch' 1" + cset "name='AIF1ADC1 HPF Mode' HiFi" + ] + + DisableSequence [ + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 0" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 0" + cset "name='MIXINR IN2R Switch' 0" + cset "name='IN2R Switch' 0" + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 0" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 0" + cset "name='MIXINL IN2L Switch' 0" + cset "name='IN2L Switch' 0" + ] + + Value { + CaptureChannels "2" + } +} + +SectionDevice."Headset" { + ConflictingDevice [ + "Mic" + ] + + EnableSequence [ + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1" + cset "name='MIXINR IN1R Switch' 1" + cset "name='MIXINR IN1R Volume' 1" + cset "name='IN1R Switch' 1" + cset "name='AIF1ADCL Source' Right" + cset "name='IN1R Volume' 16" + cset "name='AIF1ADC1 HPF Mode' HiFi" + ] + + DisableSequence [ + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 0" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 0" + cset "name='MIXINR IN1R Switch' 0" + cset "name='IN1R Switch' 0" + ] + + Value { + CaptureChannels "2" + } +} + diff --git a/device/testing/device-samsung-manta/ucm/Manta-I2S.conf b/device/testing/device-samsung-manta/ucm/Manta-I2S.conf new file mode 100644 index 000000000..ac90ab2fe --- /dev/null +++ b/device/testing/device-samsung-manta/ucm/Manta-I2S.conf @@ -0,0 +1,51 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "HiFi.conf" +} + +SectionDefaults [ + cdev "hw:MantaI2S" + + cset "name='DAC1R Mixer AIF1.1 Switch' 0" + cset "name='DAC1L Mixer AIF1.1 Switch' 0" + cset "name='DAC1 Switch' 0" + cset "name='DAC2 Switch' 0" + cset "name='AIF1DRC1 Mode' Default" + cset "name='AIF1DAC1 DRC Switch' 0" + cset "name='Speaker Switch' 0" + cset "name='SPKR DAC1 Switch' 0" + cset "name='SPKL DAC1 Switch' 0" + cset "name='Speaker Mixer Volume' 0" + cset "name='Headphone Switch' 0" + cset "name='Right Headphone Mux' DAC" + cset "name='Left Headphone Mux' DAC" + cset "name='Left Output Mixer DAC Switch' 0" + cset "name='Right Output Mixer DAC Switch' 0" + cset "name='MIXINL IN1L Switch' 0" + cset "name='IN1L Switch' 0" + cset "name='IN1L PGA IN1LP Switch' 0" + cset "name='IN1L PGA IN1LN Switch' 1" + cset "name='MIXINL IN2L Switch' 0" + cset "name='IN2L Switch' 0" + cset "name='IN2L PGA IN2LP Switch' 0" + cset "name='IN2L PGA IN2LN Switch' 1" + cset "name='MIXINR IN1R Switch' 0" + cset "name='IN1R Switch' 0" + cset "name='IN1R PGA IN1RP Switch' 0" + cset "name='IN1R PGA IN1RN Switch' 1" + cset "name='MIXINR IN2R Switch' 0" + cset "name='IN2R Switch' 0" + cset "name='IN2R PGA IN2RP Switch' 0" + cset "name='IN2R PGA IN2RN Switch' 1" + cset "name='AIF2DACL Mux' AIF3" + cset "name='AIF2DACR Mux' AIF3" + cset "name='AIF2DAC Mux' AIF3DACDAT" + cset "name='AIF3ADC Mux' AIF2ADCDAT" + cset "name='AIF1ADC1L Mixer AIF2 Switch' 0" + cset "name='AIF1ADC1R Mixer AIF2 Switch' 0" + cset "name='AIF1ADC2L Mixer AIF2 Switch' 0" + cset "name='AIF1ADC2R Mixer AIF2 Switch' 0" + cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 0" + cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 0" +] diff --git a/device/testing/device-samsung-manta/ucm/Manta-SPDIF.conf b/device/testing/device-samsung-manta/ucm/Manta-SPDIF.conf new file mode 100644 index 000000000..713d764dc --- /dev/null +++ b/device/testing/device-samsung-manta/ucm/Manta-SPDIF.conf @@ -0,0 +1,5 @@ +Syntax 3 + +SectionUseCase."SPDIF" { + File "SPDIF.conf" +} diff --git a/device/testing/device-samsung-manta/ucm/SPDIF.conf b/device/testing/device-samsung-manta/ucm/SPDIF.conf new file mode 100644 index 000000000..44284b915 --- /dev/null +++ b/device/testing/device-samsung-manta/ucm/SPDIF.conf @@ -0,0 +1,2 @@ +SectionDevice."SPDIF" { +} diff --git a/device/testing/firmware-samsung-manta/APKBUILD b/device/testing/firmware-samsung-manta/APKBUILD new file mode 100644 index 000000000..92db91640 --- /dev/null +++ b/device/testing/firmware-samsung-manta/APKBUILD @@ -0,0 +1,42 @@ +pkgname=firmware-samsung-manta +pkgver=1 +pkgrel=0 +pkgdesc="Firmware for Samsung Manta (Nexus 10)" +url="https://developers.google.com/android/drivers#mantalmy49j" +arch="armv7" +license="proprietary" +options="!check !strip !archcheck !tracedeps pmb:cross-native" +install="$pkgname.post-install" +_commitfw="5d170b264b593b75734a2c4f10f06fbe42bb5067" +_commitdev="f654b082d30391218c985cd2e2c9089e1b444e11" +source=" + manta-fw_bcmdhd.bin::https://github.com/TheMuppets/proprietary_vendor_samsung/raw/$_commitfw/manta/proprietary/vendor/firmware/fw_bcmdhd.bin + maxtouch.fw::https://github.com/TheMuppets/proprietary_vendor_samsung/raw/$_commitfw/manta/proprietary/vendor/firmware/maxtouch.fw + es305_fw.bin::https://github.com/TheMuppets/proprietary_vendor_samsung/raw/$_commitfw/manta/proprietary/vendor/firmware/es305_fw.bin + brcmfmac43241b0-sdio.samsung,manta.txt::https://raw.githubusercontent.com/LineageOS/android_device_samsung_manta/$_commitdev/bcmdhd.cal +" + +package() { + cd "$srcdir" + + # Wifi + install -Dm644 "manta-fw_bcmdhd.bin" \ + "$pkgdir/lib/firmware/postmarketos/brcm/brcmfmac43241b0-sdio.bin" + install -Dm644 "brcmfmac43241b0-sdio.samsung,manta.txt" \ + "$pkgdir/lib/firmware/postmarketos/brcm/brcmfmac43241b0-sdio.samsung,manta.txt" + + # Touchscreen + install -Dm644 "maxtouch.fw" \ + "$pkgdir/lib/firmware/postmarketos/maxtouch.fw" + + # Audience eS305 + install -Dm644 "es305_fw.bin" \ + "$pkgdir/lib/firmware/postmarketos/es305_fw.bin" +} + +sha512sums=" +0ad8b6963244e652746429e95e52c00395e38eb873a0632aab2e10a43b11fb1ef53a3c5e4863ac90d11d9c1c65e87f2067e9edda4cf0e7b06c8dc0cd3c74fb6f manta-fw_bcmdhd.bin +a7ada29e2d76c48941ae05abb6f972a628f9729ccabbea5d8adfa2fb7f107e652ef290a1770e54387b3ee798382cb4f6519344461c991b5193fdbc465b9c7644 maxtouch.fw +b16ccf4c733564fc0e7e436915ca3185ebd6bbcd33106328813b1bd8a40ff1e34c818c71c86356596f75e1b739585ab562fa279cfd0d051c0216c64759bc5dc7 es305_fw.bin +e5317fdd080ff7ea30bf326c48f230a68484e4339739553f537f9b1c0c379b48fd86b857112cf6f293f061b18d0ea82b92026ca79204c28fd2e0d71c2cd42140 brcmfmac43241b0-sdio.samsung,manta.txt +" diff --git a/device/testing/firmware-samsung-manta/firmware-samsung-manta.post-install b/device/testing/firmware-samsung-manta/firmware-samsung-manta.post-install new file mode 100644 index 000000000..7b758e41f --- /dev/null +++ b/device/testing/firmware-samsung-manta/firmware-samsung-manta.post-install @@ -0,0 +1,10 @@ +#!/bin/sh + +# Enable autostart of deferred initcalls (needed to bring Wi-Fi online) +rc-update -q add deferred-initcalls sysinit + +# Explicitly specify wlan device. Without this, p2p0 will be +# selected automatically instead of wlan0, and Wi-Fi will not work. +if ! grep -q "i wlan0" /etc/conf.d/wpa_supplicant ; then + sed -i 's/-Dnl80211,wext/-Dnl80211,wext -i wlan0/' /etc/conf.d/wpa_supplicant +fi diff --git a/device/testing/linux-samsung-manta/01-fix-video-argb-setting.patch b/device/testing/linux-samsung-manta/01-fix-video-argb-setting.patch new file mode 100644 index 000000000..24d14eac0 --- /dev/null +++ b/device/testing/linux-samsung-manta/01-fix-video-argb-setting.patch @@ -0,0 +1,18 @@ +diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c +index ac028c53f..61ef8915f 100644 +--- a/drivers/video/s3c-fb.c ++++ b/drivers/video/s3c-fb.c +@@ -508,11 +508,11 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, + case 24: + /* our 24bpp is unpacked, so 32bpp */ + var->bits_per_pixel = 32; +- var->red.offset = 16; ++ var->red.offset = 0; + var->red.length = 8; + var->green.offset = 8; + var->green.length = 8; +- var->blue.offset = 0; ++ var->blue.offset = 16; + var->blue.length = 8; + break; + diff --git a/device/testing/linux-samsung-manta/APKBUILD b/device/testing/linux-samsung-manta/APKBUILD index 8cd7d5750..f1305036a 100644 --- a/device/testing/linux-samsung-manta/APKBUILD +++ b/device/testing/linux-samsung-manta/APKBUILD @@ -2,7 +2,7 @@ pkgname=linux-samsung-manta pkgver=3.4.113 -pkgrel=6 +pkgrel=7 pkgdesc="Google Nexus 10 kernel fork" arch="armv7" _carch="arm" @@ -10,25 +10,21 @@ _flavor="samsung-manta" url="https://github.com/LineageOS/android_kernel_samsung_manta" license="GPL2" options="!strip !check !tracedeps pmb:cross-native" -makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev gcc6" - -# Compiler: this kernel was only tested with GCC6. Feel free to make a merge -# request if you find out that it is booting working with newer GCCs as -# well. See for instructions. -if [ "${CC:0:5}" != "gcc6-" ]; then - CC="gcc6-$CC" - HOSTCC="gcc6-gcc" - CROSS_COMPILE="gcc6-$CROSS_COMPILE" -fi +makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev" # Source _repository="android_kernel_samsung_manta" -_commit="21157195150c268c19303513e4e1327dc01ff89e" +_commit="2eb797e4d1338dcf963a762491790484a5dd0612" _config="config-$_flavor.$arch" source=" $pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz $_config + gcc7-give-up-on-ilog2-const-optimizations.patch + gcc8-fix-put-user.patch + gcc10-extern_YYLOC_global_declaration.patch + 01-fix-video-argb-setting.patch " + builddir="$srcdir/$_repository-$_commit" prepare() { @@ -40,11 +36,26 @@ build() { unset LDFLAGS make ARCH="$_carch" CC="${CC:-gcc}" \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" + make ARCH="$_carch" CC="${CC:-gcc}" CFLAGS_MODULE="-fno-pic" \ + KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" modules } package() { downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" + + # Modules + unset LDFLAGS + make ARCH="$_carch" CC="${CC:-gcc}" \ + KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" \ + INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 \ + modules_install } -sha512sums="11f8c197810438082bb103be9f26857e7ec1e1e49a1a8aca3bade12332ed1def62142b58219f4d17d07f0ab076708bef6c709312b784ab1c5339aa2e9db0232f linux-samsung-manta-21157195150c268c19303513e4e1327dc01ff89e.tar.gz -903b8cbb7090197b1d203350cb0590e158081719a4b50807c60bc89d25bdfce768adc6097891946be4f5574fc17bb94847f9531a9218d05c32f6ae19457816a1 config-samsung-manta.armv7" +sha512sums=" +36a60bd023016adf6c1e579293d69e03cca6d0eb1efbb62ee698af72f2d19b3cd2e60941965a56702d325dede99481a1f4e09e6644016005bc27798153d48455 linux-samsung-manta-2eb797e4d1338dcf963a762491790484a5dd0612.tar.gz +3699b8d1b3ced3cbdfe0bab45da0a22ce6f9cbefb72c9c037207b21ed7f2ca5604a80b16cbbe2e2249ff46775a800bad1fab2502275ff5fca22ad6ae80e6e180 config-samsung-manta.armv7 +77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch +197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch +2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch +8e91e309fe55c5ef4610d3ce3ec3f08b9570275bd6f8029a1c4098abce9edf25cc89d5fc2e9d1a7f336463fb6583852466bac7c08b79c411e0f0f0a9105f4ecc 01-fix-video-argb-setting.patch +" diff --git a/device/testing/linux-samsung-manta/config-samsung-manta.armv7 b/device/testing/linux-samsung-manta/config-samsung-manta.armv7 index 13a1c36a7..132d2a92f 100644 --- a/device/testing/linux-samsung-manta/config-samsung-manta.armv7 +++ b/device/testing/linux-samsung-manta/config-samsung-manta.armv7 @@ -103,7 +103,12 @@ CONFIG_FAIR_GROUP_SCHED=y CONFIG_RT_GROUP_SCHED=y # CONFIG_BLK_CGROUP is not set # CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_NAMESPACES is not set +CONFIG_NAMESPACES=y +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +CONFIG_USER_NS=y +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set # CONFIG_SCHED_AUTOGROUP is not set CONFIG_MM_OWNER=y # CONFIG_SYSFS_DEPRECATED is not set @@ -156,6 +161,7 @@ CONFIG_PROFILING=y CONFIG_TRACEPOINTS=y # CONFIG_OPROFILE is not set CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set # CONFIG_JUMP_LABEL is not set CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y @@ -181,7 +187,11 @@ CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 -# CONFIG_MODULES is not set +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +# CONFIG_MODULE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_STOP_MACHINE=y CONFIG_BLOCK=y CONFIG_LBDAF=y @@ -998,6 +1008,7 @@ CONFIG_XPS=y # CONFIG_NETPRIO_CGROUP is not set CONFIG_BQL=y CONFIG_HAVE_BPF_JIT=y +# CONFIG_BPF_JIT is not set # # Network testing @@ -1188,6 +1199,7 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports @@ -1303,8 +1315,8 @@ CONFIG_WIFI_CONTROL_FUNC=y # CONFIG_ATH_COMMON is not set CONFIG_BCMDHD=y # CONFIG_BCM4339 is not set -CONFIG_BCMDHD_FW_PATH="/system/vendor/firmware/fw_bcmdhd.bin" -CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal" +CONFIG_BCMDHD_FW_PATH="/lib/firmware/postmarketos/brcm/brcmfmac43241b0-sdio.bin" +CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/postmarketos/brcm/brcmfmac43241b0-sdio.samsung,manta.txt" # CONFIG_DHD_USE_STATIC_BUF is not set CONFIG_DHD_USE_SCHED_SCAN=y # CONFIG_BRCMFMAC is not set @@ -1401,7 +1413,7 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_ADS7846 is not set # CONFIG_TOUCHSCREEN_AD7877 is not set # CONFIG_TOUCHSCREEN_AD7879 is not set -CONFIG_TOUCHSCREEN_ATMEL_MXT=y +CONFIG_TOUCHSCREEN_ATMEL_MXT=m # CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set # CONFIG_TOUCHSCREEN_BU21013 is not set # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set @@ -1560,6 +1572,7 @@ CONFIG_I2C_S3C2410=y # # Other I2C/SMBus bus drivers # +# CONFIG_I2C_STUB is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -1804,6 +1817,7 @@ CONFIG_VIDEO_MEDIA=y # Multimedia drivers # # CONFIG_RC_CORE is not set +# CONFIG_MEDIA_ATTACH is not set CONFIG_MEDIA_TUNER=y CONFIG_MEDIA_TUNER_CUSTOMISE=y @@ -2018,8 +2032,7 @@ CONFIG_VIDEO_EXYNOS_GSCALER=y CONFIG_VIDEO_EXYNOS_JPEG=y CONFIG_VIDEO_EXYNOS_FIMG2D=y # CONFIG_VIDEO_FIMG2D_DEBUG is not set -CONFIG_EXYNOS_MFC_V6=y -CONFIG_VIDEO_EXYNOS_MFC=y +# CONFIG_VIDEO_EXYNOS_MFC is not set # # Exynos TV support @@ -2682,12 +2695,14 @@ CONFIG_STAGING=y # CONFIG_PRISM2_USB is not set # CONFIG_ECHO is not set # CONFIG_ASUS_OLED is not set +# CONFIG_RTLLIB is not set # CONFIG_R8712U is not set # CONFIG_RTS5139 is not set # CONFIG_TRANZPORT is not set # CONFIG_LINE6_USB is not set # CONFIG_USB_SERIAL_QUATECH2 is not set # CONFIG_USB_SERIAL_QUATECH_USB2 is not set +# CONFIG_VT6656 is not set CONFIG_IIO=y CONFIG_IIO_BUFFER=y # CONFIG_IIO_SW_RING is not set @@ -2831,6 +2846,7 @@ CONFIG_ZRAM=y # CONFIG_ZRAM_DEBUG is not set CONFIG_ZSMALLOC=y # CONFIG_FB_SM7XX is not set +# CONFIG_USB_ENESTORAGE is not set # CONFIG_BCM_WIMAX is not set # CONFIG_FT1000 is not set @@ -3230,6 +3246,7 @@ CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_WORKQUEUE=y # CONFIG_CRYPTO_CRYPTD is not set CONFIG_CRYPTO_AUTHENC=y +# CONFIG_CRYPTO_TEST is not set # # Authenticated Encryption with Associated Data diff --git a/device/testing/linux-samsung-manta/gcc10-extern_YYLOC_global_declaration.patch b/device/testing/linux-samsung-manta/gcc10-extern_YYLOC_global_declaration.patch new file mode 120000 index 000000000..fe99abf4d --- /dev/null +++ b/device/testing/linux-samsung-manta/gcc10-extern_YYLOC_global_declaration.patch @@ -0,0 +1 @@ +../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch \ No newline at end of file diff --git a/device/testing/linux-samsung-manta/gcc7-give-up-on-ilog2-const-optimizations.patch b/device/testing/linux-samsung-manta/gcc7-give-up-on-ilog2-const-optimizations.patch new file mode 120000 index 000000000..da3d1ed41 --- /dev/null +++ b/device/testing/linux-samsung-manta/gcc7-give-up-on-ilog2-const-optimizations.patch @@ -0,0 +1 @@ +../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch \ No newline at end of file diff --git a/device/testing/linux-samsung-manta/gcc8-fix-put-user.patch b/device/testing/linux-samsung-manta/gcc8-fix-put-user.patch new file mode 120000 index 000000000..1d40b2674 --- /dev/null +++ b/device/testing/linux-samsung-manta/gcc8-fix-put-user.patch @@ -0,0 +1 @@ +../../.shared-patches/linux/gcc8-fix-put-user.patch \ No newline at end of file