huawei-alice: add wifi firmware (MR 2234)

[ci:skip-build] already built successfully in CI
This commit is contained in:
BO41 2021-06-07 13:30:39 +02:00 committed by Clayton Craft
parent 4dce8fe188
commit 34a85fafa4
No known key found for this signature in database
GPG key ID: 7A3461CA187CEA54
7 changed files with 96 additions and 9 deletions

View file

@ -2,7 +2,7 @@
pkgname=device-huawei-alice
pkgdesc="Huawei P8 Lite"
pkgver=0.1
pkgrel=1
pkgrel=2
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
@ -11,6 +11,14 @@ depends="postmarketos-base linux-huawei-alice mkbootimg mesa-dri-gallium msm-fb-
makedepends="devicepkg-dev"
source="deviceinfo"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
nonfree_firmware() {
pkgdesc="WiFi firmware"
depends="firmware-huawei-alice"
mkdir "$subpkgdir"
}
build() {
devicepkg_build $startdir $pkgname
}
@ -19,4 +27,6 @@ package() {
devicepkg_package $startdir $pkgname
}
sha512sums="46f59ceedfba290257bc35001f2e28253012807f7556e7a7270d137cfe047566a1d02d3bf27f6c7dbeba866a9cfaae0cc2416576828d3600693894fd306c4245 deviceinfo"
sha512sums="
46f59ceedfba290257bc35001f2e28253012807f7556e7a7270d137cfe047566a1d02d3bf27f6c7dbeba866a9cfaae0cc2416576828d3600693894fd306c4245 deviceinfo
"

View file

@ -0,0 +1,28 @@
pkgname=firmware-huawei-alice
pkgver=1
pkgrel=0
pkgdesc="Firmware for Huawei P8 Lite"
url="https://git.sr.ht/~bo41/firmware-huawei-alice"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck"
install="$pkgname.post-install"
# Sources
_commit="6aa2ebaa11caaccbe29f2764c24a54d2bc4a77bd"
source="$pkgname-$_commit.tar.gz::$url/archive/$_commit.tar.gz alice-wlan"
_fwdir="/lib/firmware/postmarketos"
builddir="$srcdir/$pkgname-$_commit"
package() {
pkgdesc="Huawei Alice WiFi firmware"
# WiFi
install -Dm644 * -t "$pkgdir/$_fwdir"
install -Dm755 "$srcdir"/alice-wlan "$pkgdir"/etc/init.d/alice-wlan
}
sha512sums="
76e5b925021e892a53961f7d638d1562862e22759aef4de84ad7a5f1a2018595030bd063da9fc7b430d3ddc44eed1f724a1a35e943cd1289ed6e696303851623 firmware-huawei-alice-6aa2ebaa11caaccbe29f2764c24a54d2bc4a77bd.tar.gz
6215df9b73f10ca4ee5cb678c34b2fb668c78a3ce46439b4c1b9d7d339a4216cc7bc0a8a74e0c5057fa5416a07b83de5b453bbdfd2a2dc95bdff53282c0d7c55 alice-wlan
"

View file

@ -0,0 +1,18 @@
#!/sbin/openrc-run
description="Initialize hi1101 wlan driver"
depend()
{
need udev
before wpa_supplicant
}
start()
{
ebegin "Enabling wlan driver"
echo 1 > /sys/devices/hi110x_ps/bfg_lowpower_enable
echo 12 > /sys/devices/hi110x_power/powerpin_state
echo 1 > /proc/wifi_enable/wifi_start
echo 1 > /proc/oam_enable/oam_start
}

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Enable alice-wlan init script
rc-update add alice-wlan default

View file

@ -0,0 +1,26 @@
diff --git a/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_board.h b/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_board.h
index 115419a1..151f98f1 100755
--- a/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_board.h
+++ b/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_board.h
@@ -38,7 +38,7 @@ extern "C" {
#define SDIO_RW_NAME_LEN 128
#define INI_NAME_LEN 128
-#define RW_SDIO_PATH "/system/vendor/firmware/"
+#define RW_SDIO_PATH "/lib/firmware/postmarketos/"
#define DTS_COMP_HI1101_RW_NAME "hisilicon,hi1101-power"
diff --git a/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_patch.h b/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_patch.h
index cbc34a54..cbabf858 100755
--- a/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_patch.h
+++ b/drivers/huawei_platform/connectivity/hisi/hw-pm/wireless_patch.h
@@ -75,7 +75,7 @@ extern "C" {
#define SDIO_CFG_FILE "./config/sdio_cfg"
#else
#define UART_CFG_FILE "/system/vendor/firmware/uart_cfg"
-#define SDIO_CFG_FILE "/system/vendor/firmware/sdio_cfg"
+#define SDIO_CFG_FILE "/lib/firmware/postmarketos/sdio_cfg"
#define SDIO_RECOVER_CFG_FILE "/system/vendor/firmware/sdio_recover_cfg"
#define SDIO_RECOVER_FLAG_FILE "/data/hwlogdir/recoverflag"
#endif

View file

@ -1,9 +1,9 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/alice.defconfig)
# Kernel config based on: arch/arm64/configs/alice_defconfig
pkgname=linux-huawei-alice
pkgver=3.10.108
pkgrel=1
pkgrel=2
pkgdesc="Huawei P8 Lite kernel fork"
arch="aarch64"
_carch="arm64"
@ -22,7 +22,7 @@ fi
# Source
_repository="android_kernel_huawei_alice"
_commit="0f650cf363b7911523ec5f11aebcdfa5abc55007"
_commit="202b1ab540532cdd7f73532061ff7d3f9ba54d3c"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/DarkJoker360/$_repository/archive/$_commit.tar.gz
@ -30,8 +30,8 @@ source="
02_fix_undeclared_AID_INET.patch
03_fix_get_ro_secure.patch
04_fix_hisiwifi_makefiles.patch
05-change-wifi-cfg-path.patch
$_config
gcc10-extern_YYLOC_global_declaration.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
@ -51,10 +51,12 @@ package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
}
sha512sums="0432f760efbf0ac64a51e0ad229b2c3a3400ca8e0b7be04fce81b352482d980b7ae89ccfab445bbfa0c9be23691049b1de94d5523677e955c98afbc0eef84de1 linux-huawei-alice-0f650cf363b7911523ec5f11aebcdfa5abc55007.tar.gz
sha512sums="
c5d6507ada8b1d3c97dd54a276c8e92760418468e43b0f545532582331a7e7df33963196ff7981bc697e7e5e5fcaffac61d2f9cbfcc0c44392810c40db1851bb linux-huawei-alice-202b1ab540532cdd7f73532061ff7d3f9ba54d3c.tar.gz
1c05b67b1dd8e42f7c26ce5d48d3194ce4e123b420643ce1f207e1b40b2e45134e280b78369633b9bfa2871b5cde6221f5083fa00b21fd252d1b85018ee3994d 01_fix_types_include.patch
33599989d5088bb58bcbebe1b33f324fca130fac7f4938e848c07abafb119af9cebf94ef4acf786b5e43e9199a8200aa216a4238a0331d426861651204aea8c8 02_fix_undeclared_AID_INET.patch
11e2825cec9fde87241b43993b956872c6686c5c76acef0332867c14fb3b6c4d64dc1d54d8dc6edb1e3375fd2369918912598a413f279a885f253630a658a4c6 03_fix_get_ro_secure.patch
2a7f487903a7f97ae50acb42a35096d688b51285f62e36ce0a70110539ffb6b116cb9cf1796d6332fe78c1a2ff597ece2ffa551428e92610c97ef635d52c57fb 04_fix_hisiwifi_makefiles.patch
c44e6b18f6fa87a779855ba2fbfdec9f7bbb254fcc8d50d086870b57d3dc05a2c2d095f9fead1549e206e1b2806b8d449af2ec01e951257c21c5ef0d3757ca03 05-change-wifi-cfg-path.patch
382a70aec6f7bec6dbf50a2e67ead029a71a7f14cdac6a95d5b91f60f5ddde07d014a23e17227805f3bcce8e90d9403b98dd07aed92c0ed87f31fe167444ee7e config-huawei-alice.aarch64
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch"
"

View file

@ -1 +0,0 @@
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch