From 580ff697290315881c4a4ba3549b3780b76ade7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Romanik?= Date: Sat, 11 Jun 2022 21:20:06 +0200 Subject: [PATCH] samsung-crownlte: add Bluetooth support (MR 3224) [ci:skip-build]: already built successfully in CI --- .../device-samsung-crownlte/10-hciattach.rules | 5 +++++ device/testing/device-samsung-crownlte/APKBUILD | 16 +++++++++++++--- device/testing/device-samsung-crownlte/hciattach | 4 ++++ .../testing/firmware-samsung-crownlte/APKBUILD | 11 ++++++++--- device/testing/linux-samsung-crownlte/APKBUILD | 4 ++-- .../config-samsung-crownlte.aarch64 | 14 +++++++++++++- 6 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 device/testing/device-samsung-crownlte/10-hciattach.rules create mode 100644 device/testing/device-samsung-crownlte/hciattach diff --git a/device/testing/device-samsung-crownlte/10-hciattach.rules b/device/testing/device-samsung-crownlte/10-hciattach.rules new file mode 100644 index 000000000..eb4db3750 --- /dev/null +++ b/device/testing/device-samsung-crownlte/10-hciattach.rules @@ -0,0 +1,5 @@ +# BT unblocked +SUBSYSTEM=="rfkill", ATTR{name}=="bcm43xx Bluetooth", ACTION=="change", ENV{RFKILL_STATE}=="1", RUN+="/etc/init.d/hciattach start" + +# BT blocked +SUBSYSTEM=="rfkill", ATTR{name}=="bcm43xx Bluetooth", ACTION=="change", ENV{RFKILL_STATE}=="0", RUN+="/etc/init.d/hciattach stop" diff --git a/device/testing/device-samsung-crownlte/APKBUILD b/device/testing/device-samsung-crownlte/APKBUILD index 08bf14f1a..45d1adafc 100644 --- a/device/testing/device-samsung-crownlte/APKBUILD +++ b/device/testing/device-samsung-crownlte/APKBUILD @@ -1,7 +1,7 @@ # Reference: pkgname=device-samsung-crownlte pkgdesc="Samsung Galaxy Note 9" -pkgver=0.2 +pkgver=0.3 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -19,6 +19,8 @@ source=" deviceinfo initfs-hook.sh stylus.conf + hciattach + 10-hciattach.rules " subpackages=" $pkgname-nonfree-firmware:nonfree_firmware @@ -34,9 +36,15 @@ package() { } nonfree_firmware() { - pkgdesc="WiFi firmware" - depends="firmware-samsung-crownlte" + pkgdesc="WiFi and BT firmware" + depends="firmware-samsung-crownlte bluez-deprecated" + + # hciattach service for Bluetooth mkdir "$subpkgdir" + install -Dm755 "$srcdir"/hciattach \ + "$subpkgdir"/etc/init.d/hciattach + install -Dm644 "$srcdir"/10-hciattach.rules \ + "$subpkgdir"/etc/udev/rules.d/10-hciattach.rules } x11() { @@ -50,4 +58,6 @@ sha512sums=" 4d947f71b2eab1c82e727fb5592c82b27db5180a2ecdc807246d4807fa83b0539dca984e2330f80e4942694d77773fd83d56fb5b77c2f50c574e7815aabbfd1d deviceinfo cec13a1cb076a249eb94d11fb122b1f6b0c3e9558a2ed3c8da3e73a8e2db633131ec8ce838e62da8f53b5500dcb77c6f4adf3c1d2f1cda6fd23cb2ca1ccf6abc initfs-hook.sh 29c2f8fbd67f6aa95a34fc465798be71dc360087b4e4fddbcdc9b43a628de384f48c1b9e6a7b3d41c93954baee3b88f08972f0a827d663b0279b06a4b2908bd2 stylus.conf +70c4d3b7af9e58729b5caca87c6c0032675c4adfd3852b0e3fc1f866675d503c4f08d3edaf1b1949bf15344840222c1a7ba00384c290fa5e1b7742e1198855a8 hciattach +58f72bb12532ce23782389bf9e9eb8eb8afe004dd46d11d48b21b6da6a84660846f79d528d9968a1c1be57716577035fd0da59b3fcda4f197599e92f243dbb45 10-hciattach.rules " diff --git a/device/testing/device-samsung-crownlte/hciattach b/device/testing/device-samsung-crownlte/hciattach new file mode 100644 index 000000000..b07f400e1 --- /dev/null +++ b/device/testing/device-samsung-crownlte/hciattach @@ -0,0 +1,4 @@ +#!/sbin/openrc-run + +command="/usr/bin/hciattach" +command_args="/dev/ttySAC1 bcm43xx 3000000" diff --git a/device/testing/firmware-samsung-crownlte/APKBUILD b/device/testing/firmware-samsung-crownlte/APKBUILD index be333af0d..861508e86 100644 --- a/device/testing/firmware-samsung-crownlte/APKBUILD +++ b/device/testing/firmware-samsung-crownlte/APKBUILD @@ -1,5 +1,5 @@ pkgname=firmware-samsung-crownlte -pkgver=1 +pkgver=2 pkgrel=0 pkgdesc="Firmware for the Samsung Galaxy Note 9" url="https://github.com/rom4nik/android_vendor_samsung" @@ -10,15 +10,19 @@ options="!check !archcheck !strip !spdx !tracedeps pmb:cross-native" # Source _commit="e1494313c7223c0bb39a9c9f91b3f68bdcd204e7" _wifi_files="bcmdhd_sta.bin_b2 bcmdhd_clm.blob nvram.txt_r02a_b2" +_firmware_files="bcm4361B2_semco.hcd" for _file in $_wifi_files; do source="$source $pkgname-$_commit-$_file::$url/raw/$_commit/universal9810-common/proprietary/vendor/etc/wifi/$_file" done +for _file in $_firmware_files; do + source="$source $pkgname-$_commit-$_file::$url/raw/$_commit/crownlte/proprietary/vendor/firmware/$_file" +done + package() { - # Wifi local file - for file in $_wifi_files; do + for file in $_wifi_files $_firmware_files; do install -Dm644 "$srcdir/$pkgname-$_commit-$file" \ "$pkgdir/lib/firmware/postmarketos/$file" done @@ -28,4 +32,5 @@ sha512sums=" af96fa7245c06ca494eb6c43903a39795e2f9d316db4df4e88ea63837d87f41933259812503d62851c3bd9b4d6f126979193190544cb3c4db6b6b304661bdab9 firmware-samsung-crownlte-e1494313c7223c0bb39a9c9f91b3f68bdcd204e7-bcmdhd_sta.bin_b2 15647eb158603dfee3d14420703e0f05c89fa91a9aaf35b9ea92197f1c75b1aaa1046d18ef539c5d600542ce87ab6b7a776b4616896be3aae192361019996051 firmware-samsung-crownlte-e1494313c7223c0bb39a9c9f91b3f68bdcd204e7-bcmdhd_clm.blob 7a9d701311a1e00248c0367c9eea8ab2bf8a4ad859513b55c47b33a000cad784a1ba8ea390e972f13c4e64825e8ca84f3c547bd1a8a7d6861df1b89ad9a18d18 firmware-samsung-crownlte-e1494313c7223c0bb39a9c9f91b3f68bdcd204e7-nvram.txt_r02a_b2 +6928f40a4ac0db839b9654e1f3f74d0444cbca219d998c84fabe9f8dc432002d3b5b20135f2b489ff45ee2509184a88f37c3a695b46fd3b58b1e987a103ff37c firmware-samsung-crownlte-e1494313c7223c0bb39a9c9f91b3f68bdcd204e7-bcm4361B2_semco.hcd " diff --git a/device/testing/linux-samsung-crownlte/APKBUILD b/device/testing/linux-samsung-crownlte/APKBUILD index 4bba4cc09..f88c5c4bf 100644 --- a/device/testing/linux-samsung-crownlte/APKBUILD +++ b/device/testing/linux-samsung-crownlte/APKBUILD @@ -3,7 +3,7 @@ pkgname=linux-samsung-crownlte pkgver=4.9.218 -pkgrel=1 +pkgrel=2 pkgdesc="Samsung Galaxy Note 9 kernel fork" arch="aarch64" _carch="arm64" @@ -62,7 +62,7 @@ package() { sha512sums=" a19967220faac402dd6fc2424f89cc236f367047d069a2234ca391e44a47fe04e3aff9562dd0be6f6b81d80e95fc7daf3edb26cf29349a35e0dc1c4af4fcb813 linux-samsung-crownlte-5a2dd7d6f3a05168d2f1303c3b29e9e9fa39b781.tar.gz -940d98d0596f1a571f839bfe293e1b75c004cdc18c4536e5ade4f6637d1965ba75be6e0b67c6bb668d5dac0a4c9b505d43f6c1ea0920ee7d445dfe5da63a0613 config-samsung-crownlte.aarch64 +6857ab47974cc603edce357863f9a0dcadd1c492946572fd9897190eae5042f859b23660b4761acef889983fe8475b3d27255690114b1e63ce9e3a16058105ac config-samsung-crownlte.aarch64 8d56a239cbd488692249ba856f3e949863dbb60edacfc862171f7b42c2564e99009ba88c8299b2179f468291fdc0de118235307acad07ec88342b8e68ee6f075 01-decon_reg.patch 65f5b1541bf3d4dab9db3d5de2aa888e794772f66d85541d11fbf515e7ec9188cda2ec46411f5469d8485caa5f405ffa16159f556bd9180c0cd3a527b14f9f5f 02-decon_dsi-BGRA-to-RGBA.patch 24eb8701d77ad6cfc98a153341874d753a67930a369b1a08d8d51682a5d1014971e106bda93b7180bcacdf7032bb952fdca02f68886ea27c761eab8fefdb03fa 03-decon_dsi-UNBLANK-missed.patch diff --git a/device/testing/linux-samsung-crownlte/config-samsung-crownlte.aarch64 b/device/testing/linux-samsung-crownlte/config-samsung-crownlte.aarch64 index c51f16198..9b31361fd 100644 --- a/device/testing/linux-samsung-crownlte/config-samsung-crownlte.aarch64 +++ b/device/testing/linux-samsung-crownlte/config-samsung-crownlte.aarch64 @@ -1152,10 +1152,22 @@ CONFIG_BT_LE=y # # Bluetooth device drivers # +CONFIG_BT_BCM=y # CONFIG_BT_HCIBTUSB is not set # CONFIG_BT_HCIBTSDIO is not set -# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_BCSP is not set +# CONFIG_BT_HCIUART_ATH3K is not set +# CONFIG_BT_HCIUART_LL is not set +# CONFIG_BT_HCIUART_3WIRE is not set +# CONFIG_BT_HCIUART_INTEL is not set +CONFIG_BT_HCIUART_BCM=y +# CONFIG_BT_HCIUART_QCA is not set +# CONFIG_BT_HCIUART_AG6XX is not set +# CONFIG_BT_HCIUART_MRVL is not set # CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBPA10X is not set # CONFIG_BT_HCIBFUSB is not set # CONFIG_BT_HCIVHCI is not set # CONFIG_BT_MRVL is not set