huawei-berlin: new device (MR 4640)

[ci:skip-build] already built successfully in CI
This commit is contained in:
markochk 2023-12-17 11:41:01 +01:00 committed by Clayton Craft
parent e52a249972
commit 865a0c2e54
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
13 changed files with 5374 additions and 0 deletions

View file

@ -0,0 +1,37 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: markochk <markochk@proton.me>
pkgname=device-huawei-berlin
pkgdesc="Huawei Honor 6X"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-huawei-berlin
mkbootimg
msm-fb-refresher
postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Wifi firmware"
depends="firmware-huawei-berlin hisi-wlan"
mkdir "$subpkgdir"
}
sha512sums="
21fc9dbd9c7da1549e9204e0512a3fa5b55348f671d40a7d4d1e22577605c48e1867bf0a96d637cbe2bb48b6b1dfcd9c113c8a3fde727fb7483e5e242d1d81b6 deviceinfo
"

View file

@ -0,0 +1,30 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Huawei Honor 6X"
deviceinfo_manufacturer="Huawei"
deviceinfo_codename="huawei-berlin"
deviceinfo_year="2016"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="loglevel=4 coherent_pool=512K page_tracker=on slub_min_objects=12 unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=enforcing buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_header_version="0"
deviceinfo_flash_offset_base="0x00478000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x07b88000"
deviceinfo_flash_offset_second="0x00e88000"
deviceinfo_flash_offset_tags="0x07988000"

View file

@ -0,0 +1,34 @@
pkgname=firmware-huawei-berlin
pkgver=1
pkgrel=0
pkgdesc="Firmware for Huawei Honor 6X"
url="https://gitlab.com/ignapk/warsaw-firmware"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !spdx !tracedeps pmb:cross-native"
# Source
_commit="ce27f92d3d2af58150cefe0877cf6940b865dc28"
_repository="warsaw-firmware"
_url="https://gitlab.com/ignapk"
source="$_repository-$_commit.tar.gz::$_url/$_repository/-/archive/$_commit.tar.gz"
package() {
# Wifi
install -Dm644 "$srcdir/$_repository-$_commit/CPU_RAM_SCHED.bin" \
"$pkgdir/lib/firmware/postmarketos/CPU_RAM_SCHED.bin"
install -Dm644 "$srcdir/$_repository-$_commit/CPU_RAM_WBS.bin" \
"$pkgdir/lib/firmware/postmarketos/CPU_RAM_WBS.bin"
install -Dm644 "$srcdir/$_repository-$_commit/bfgx_and_wifi_cfg" \
"$pkgdir/lib/firmware/postmarketos/bfgx_and_wifi_cfg"
install -Dm644 "$srcdir/$_repository-$_commit/bfgx_cfg" \
"$pkgdir/lib/firmware/postmarketos/bfgx_cfg"
install -Dm644 "$srcdir/$_repository-$_commit/cr4_asic.bin" \
"$pkgdir/lib/firmware/postmarketos/cr4_asic.bin"
install -Dm644 "$srcdir/$_repository-$_commit/wifi_cfg" \
"$pkgdir/lib/firmware/postmarketos/wifi_cfg"
}
sha512sums="
f30151200f1c554445e1dc451cd8c7bfb5a9dbb1c048eb468da714b72d00caea273333ebd749a58e78ad526715782b02691a896c6d9de076bd106bcf41ffaf4a warsaw-firmware-ce27f92d3d2af58150cefe0877cf6940b865dc28.tar.gz
"

View file

@ -0,0 +1,27 @@
--- b/net/Kconfig
+++ a/net/Kconfig
@@ -80,7 +80,6 @@
Short answer: say Y.
if INET
-source "net/wireguard/Kconfig"
source "net/ipv4/Kconfig"
source "net/ipv6/Kconfig"
source "net/netlabel/Kconfig"
--- b/net/Makefile
+++ a/net/Makefile
@@ -14,7 +14,6 @@
obj-$(CONFIG_LLC) += llc/
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
obj-$(CONFIG_NETFILTER) += netfilter/
-obj-$(CONFIG_WIREGUARD) += wireguard/
obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_XFRM) += xfrm/
obj-$(CONFIG_UNIX) += unix/
--- b/scripts/Kbuild.include
+++ a/scripts/Kbuild.include
@@ -365,7 +365,6 @@
endef
#
###############################################################################
-$(shell cd "$(srctree)" && ./scripts/fetch-latest-wireguard.sh)

View file

@ -0,0 +1,14 @@
diff --git a/net/core/sock.c b/net/core/sock.c
index 98568723..bad3dac7 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -141,9 +141,7 @@
#include <net/tcp.h>
#endif
-#ifdef CONFIG_ANDROID_PARANOID_NETWORK
#include <linux/android_aid.h>
-#endif
#include <net/busy_poll.h>

View file

@ -0,0 +1,11 @@
--- a/scripts/Makefile.lib 2021-01-04 14:53:56.447554188 +0100
+++ b/scripts/Makefile.lib 2021-01-04 14:54:57.445167162 +0100
@@ -293,7 +293,7 @@
$(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)
-DTCTOOL = $(KBUILD_SRC)/tools/dtc
+DTCTOOL = dtc
quiet_cmd_dtc = DTC $@
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \

View file

@ -0,0 +1,22 @@
diff --git a/drivers/hisi/mntn/blackbox/platform_ap/rdr_hisi_ap_adapter.c b/drivers/hisi/mntn/blackbox/platform_ap/rdr_hisi_ap_adapter.c
index ddefead5..66373bde 100644
--- a/drivers/hisi/mntn/blackbox/platform_ap/rdr_hisi_ap_adapter.c
+++ b/drivers/hisi/mntn/blackbox/platform_ap/rdr_hisi_ap_adapter.c
@@ -194,7 +194,7 @@ static unsigned long exception_buf_len __attribute__((__section__(".data")));
* You should not use this function to access IO space, use memcpy_toio()
* or memcpy_fromio() instead.
*/
-__no_sanitize_address static void *memcpy_rdr(void *dest, const void *src, size_t count)
+__attribute__((no_sanitize_address)) static void *memcpy_rdr(void *dest, const void *src, size_t count)
{
char *tmp = dest;
const char *s = src;
@@ -1047,7 +1047,7 @@ void regs_dump(void)
}
}
-__no_sanitize_address void last_task_stack_dump(void)
+__attribute__((no_sanitize_address)) void last_task_stack_dump(void)
{
int i;
unsigned char *dst = NULL;

View file

@ -0,0 +1,53 @@
From cc641d66eef1e8c67ac36d099d23cee52ca83836 Mon Sep 17 00:00:00 2001
From: Henkate <robertpopescu95@yahoo.com>
Date: Mon, 30 Oct 2017 21:46:29 +0200
Subject: [PATCH] drivers/hwbfm: Disable huawei Bootfail Monitor
* Ive tried to disable configs in defconfig and also removing the driver entirely, but i keep getting build errors after solving an error.
* I dont know if there is a simpler/better way to disable this since i lack C++ knowledge and its been a long time since ive did something in C++ ( i learnt some basic C++ at high school, but not advanced).
* Now the phone doesnt reboot anymore and in dmesg appears:
3,1093,2579384,-;func: bfm_init line: 2616, BFMR is disabled!
* This driver is causing the phone to reboot to erecovery.
* According to dmesg, the driver doesnt see that the phone booted succesfully, and after 30 mins since boot it reboots to erecovery.
<3>[340, hwboot_time][ 1806.180155] hwboot_timer:update timer [long and short]!
<3>[340, hwboot_time][ 1806.180170] hwboot_timer: 30 minutes timer expired! boot fail!
<6>[340, hwboot_time][ 1806.180177] >>>>enter func: boot_fail_err, line: 1346.
<6>[340, hwboot_time][ 1806.180183] boot_stage = 0x0300000f
<3>[12505, bfm_process_upp][ 1806.182136] get_ats_1_secs:ats_tmp=1504886599626
<3>[12505, bfm_process_upp][ 1806.182145] func: try_to_recovery line: 1210, boot_fail_stage:300000f NATIVE_STAGE_START: 4000000 boot_fail_no: 3000005 suggested_recovery_method: 0
<3>[12505, bfm_process_upp][ 1806.182151] func: try_to_recovery line: 1218, File: ../../../../../../kernel/huawei/msm8953/drivers/hwbfm/bfr/core/bfr_core.c Line: 1218 bfr_read_recovery_record
<3>[12505, bfm_process_upp][ 1806.249175] func: try_to_recovery line: 1229, File: ../../../../../../kernel/huawei/msm8953/drivers/hwbfm/bfr/core/bfr_core.c Line: 1229 bfr_select_recovery_method
<6>[12505, bfm_process_upp][ 1806.249193] >>>>enter func: bfr_select_recovery_method, line: 425.
<3>[12505, bfm_process_upp][ 1806.249200] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000001, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249206] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000001, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249213] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000005, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249219] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000004, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249224] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000004, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249231] func: bfm_is_bottom_layer_boofail line: 402, cur_boot_fail_no: 0x03000005, bootstage in bootfail errno: 3
<3>[12505, bfm_process_upp][ 1806.249238] func: bfr_select_recovery_method line: 460, bf_total_times:6 bf_bottom_layer_times: 6 bf_app_times: 0
<3>[12505, bfm_process_upp][ 1806.249245] func: bfr_select_recovery_method line: 552, [APP has no boot fail] FRM_GOTO_ERECOVERY_DOWNLOAD_RECOVERY
<3>[12505, bfm_process_upp][ 1806.249252] func: try_to_recovery line: 1239, File: ../../../../../../kernel/huawei/msm8953/drivers/hwbfm/bfr/core/bfr_core.c Line: 1239 bfr_create_recovery_record
<3>[12505, bfm_process_upp][ 1806.266430] func: try_to_recovery line: 1256, File: ../../../../../../kernel/huawei/msm8953/drivers/hwbfm/bfr/core/bfr_core.c Line: 1256 bfr_run_recovery_method
Change-Id: Ib9e99d6eaf47486143db6fd692f030ccbc63b2cc
---
drivers/hwbfm/main/bfmr_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwbfm/main/bfmr_main.c b/drivers/hwbfm/main/bfmr_main.c
index 31921b0cc36..f81f86f343b 100644
--- a/drivers/hwbfm/main/bfmr_main.c
+++ b/drivers/hwbfm/main/bfmr_main.c
@@ -64,7 +64,7 @@ static int __init early_parse_bfmr_enable_flag(char *p)
{
if (0 == strncmp(p, "1", strlen("1")))
{
- s_is_bfmr_enabled = 1;
+ s_is_bfmr_enabled = 0;
}
else
{

View file

@ -0,0 +1,17 @@
diff --git a/drivers/connectivity/hisi/platform/pm/plat_firmware.c b/drivers/connectivity/hisi/platform/pm/plat_firmware.c
index 9eb6ad8f3b78..8987eb0e4973 100755
--- a/drivers/connectivity/hisi/platform/pm/plat_firmware.c
+++ b/drivers/connectivity/hisi/platform/pm/plat_firmware.c
@@ -60,9 +60,9 @@
/*****************************************************************************
2 şęś¨Ňĺ
*****************************************************************************/
-#define BFGX_AND_WIFI_CFG_PATH "/vendor/firmware/bfgx_and_wifi_cfg"
-#define WIFI_CFG_PATH "/vendor/firmware/wifi_cfg"
-#define BFGX_CFG_PATH "/vendor/firmware/bfgx_cfg"
+#define BFGX_AND_WIFI_CFG_PATH "/lib/firmware/postmarketos/bfgx_and_wifi_cfg"
+#define WIFI_CFG_PATH "/lib/firmware/postmarketos/wifi_cfg"
+#define BFGX_CFG_PATH "/lib/firmware/postmarketos/bfgx_cfg"
#define RAM_CHECK_CFG_PATH "/vendor/firmware/ram_reg_test_cfg"
#define BFGX_AND_WIFI_CFG_BUILDIN_PATH "/bfgx_and_wifi_cfg"

View file

@ -0,0 +1,13 @@
diff --git a/drivers/connectivity/hisi/wifi/wal/wal_linux_cfg80211.c b/drivers/connectivity/hisi/wifi/wal/wal_linux_cfg80211.c
index 5c7a7673e063..f62bf39cb149 100755
--- a/drivers/connectivity/hisi/wifi/wal/wal_linux_cfg80211.c
+++ b/drivers/connectivity/hisi/wifi/wal/wal_linux_cfg80211.c
@@ -5660,7 +5660,7 @@ OAL_STATIC oal_wireless_dev_stru * wal_cfg80211_add_virtual_intf(oal_wiphy_stru
pst_net_dev = pst_p2p0_hmac_vap->pst_p2p0_net_device;
pst_wdev = pst_net_dev->ieee80211_ptr;
#endif
- return pst_wdev;
+ return ERR_PTR(-EINVAL);
case NL80211_IFTYPE_P2P_CLIENT:
en_vap_mode = WLAN_VAP_MODE_BSS_STA;
en_p2p_mode = WLAN_P2P_CL_MODE;

View file

@ -0,0 +1,72 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/merge_hi6250_defconfig
pkgname=linux-huawei-berlin
pkgver=4.4.174
pkgrel=0
pkgdesc="Huawei Honor 6X kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="huawei-berlin"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
dtc
findutils
flex
openssl-dev
perl
xz
"
# Source
_repository="labyrinth_kernel_prague"
_commit="f148d781c3d6bad4bae8d1c4073e233abeca9c96"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/Dil3mm4/$_repository/archive/$_commit.tar.gz
$_config
01_remove_wireguard.patch
02_fix_undeclared_AID_INET.patch
03_fix_dtc.patch
04_make_rdr_hisi_adapter_compileable.patch
05-disable-huawei-bfmr.patch
06-change-bfgx-and-wifi-cfg-paths.patch
07-fix-p2p.patch
linux4.2-gcc10-extern_YYLOC_global_declaration.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
}
sha512sums="
457975f60727cb0d6e0a62a2706fc37431480f47635b8deed178843d71a8ae9f0893f33e84b0b41dbfe33e47c7b4b05aa99efbc57fa4411bdbf48395b3340f3e linux-huawei-berlin-f148d781c3d6bad4bae8d1c4073e233abeca9c96.tar.gz
e5df13cbd10d067ef208a573f6bb2579f5f1069b7b7b6fc00e9e12e050bf8c5240e50a7d951d29d65fa8b45728de6e694e0dfd3f976e6501d62412eae81b51e1 config-huawei-berlin.aarch64
16e092ed5f22db789c8f6531c2ac082ae13e82fcfa0d3fb8bc85dca7b563e484bc70b4144cc96882df75c26f005d45122277b3e7e4e83cb478860c62123ecf63 01_remove_wireguard.patch
c02310ae289c85b7a3f85e3f4a95795ca048d6201bcfd227d1b17618b2643d2df2b65477b162463c1c02a0df8ad70915d9dd63c83edcfb7c3b3c9bd1bdebd9ca 02_fix_undeclared_AID_INET.patch
3c7120bf70cdf508f2d5c919d1e0fa9e716882e3774e146ab953e9708f353d0e71af5325e0e9c881601aa90d6f131892b2f7e8b9bd774b4f993d17da189e5141 03_fix_dtc.patch
cdc60b6c829df3b014226b9cb506ed71cf005cf5fec8d4339b54a23f052465501aaa4983ec00f33ef301db2e6a70b24a30439b3f6ce8f7c00348c05d3132ec3f 04_make_rdr_hisi_adapter_compileable.patch
6e420722576111a7ba49f265a66de632631c13d1bdb67553916d2156149226526daedc8298d83a38115c0a7189497cdb92b0daa0a263a92e6093f575e855a6e5 05-disable-huawei-bfmr.patch
ebba6534c200dd174e0ea8915c88e7fe4cf5a5ffb59b21ab4dcf25a64bfd3ba8b9be027e1c29f7c39aa86f659431e1819371fe7d3bd78ccbd8aab82ff164671f 06-change-bfgx-and-wifi-cfg-paths.patch
71b3783d21eff6b43aec7b97d16e64696bd39ac191984254fb77d28db17f5f940beb3e3f0516468d698f6e10e936b8d38aa97f7e39004a3a17491de454ecdccb 07-fix-p2p.patch
eaf2e61fcb508cdd239b8fed209d2a09ecac77287f6b46d003918fdf1c6fa2ee63f7390f3ff7c49029b8ed6cbcdd81c7e9a4b1ece9f5060b6fc84e322bd47f41 linux4.2-gcc10-extern_YYLOC_global_declaration.patch
"

File diff suppressed because it is too large Load diff

View file

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