New device: huawei-cameron (Huawei Mediapad M5 pro) (!133)

The device boots, USB networking is available and the display does also
work, even though the default display brightness seems to be zero. More
information can be found in the wiki.
This commit is contained in:
JohnBergago 2019-01-03 12:14:16 +01:00 committed by Oliver Smith
parent ef59cc8a30
commit b21caaeeb8
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 5636 additions and 0 deletions

View file

@ -0,0 +1,22 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-huawei-cameron"
pkgdesc="Huawei Mediapad M5 Pro"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-huawei-cameron mkbootimg mesa-dri-swrast msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="d4030d9cf05b273b80d7464b0cf8cd841ba6be7178e823be6fe654c4748593019f35a00913515a0ecfc8ce9c727c1b30094af32e63fcfa387d47a0fe2af33f0a deviceinfo"

View file

@ -0,0 +1,33 @@
# 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 Mediapad M5 Pro"
deviceinfo_manufacturer="Huawei"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
deviceinfo_codename="huawei-cameron"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="2560"
deviceinfo_screen_height="1600"
deviceinfo_dev_touchscreen=""
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,13 @@
diff --git a/drivers/hisi/tzdriver/Makefile b/drivers/hisi/tzdriver/Makefile
index 45521e25..799b61d3 100644
--- a/drivers/hisi/tzdriver/Makefile
+++ b/drivers/hisi/tzdriver/Makefile
@@ -19,7 +19,7 @@ $(obj)/cfc_data.o: $(obj)/cfc_data.c
$(obj)/cfc_data.c: $(src)/cfc_graphgen.py $(src)/cfc_graph.py $(src)/cfc_codegen.py $(src)/cfc_rule_parser.py $(src)/template $(obj)/rule.out
+python $(srctree)/$(src)/cfc_codegen.py $(obj)/rule.out > $@
$(obj)/rule.out: $(src)/rule.in
- aarch64-linux-android-cpp $(srctree)/$(src)/rule.in > $@
+ $(CROSS_COMPILE)cpp $(srctree)/$(src)/rule.in > $@
ccflags-y += -Idrivers/video/hisi/dss \

View file

@ -0,0 +1,16 @@
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,9 @@
#include <net/tcp.h>
#endif
-#ifdef CONFIG_ANDROID_PARANOID_NETWORK
+//#ifdef CONFIG_ANDROID_PARANOID_NETWORK
#include <linux/android_aid.h>
-#endif
+//#endif
#include <net/busy_poll.h>

View file

@ -0,0 +1,32 @@
diff --git a/init/Kconfig b/init/Kconfig
index 7a214a1a..23116f1d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -99,21 +99,27 @@ config LOCALVERSION_AUTO
config HAVE_KERNEL_GZIP
bool
+ default y
config HAVE_KERNEL_BZIP2
bool
+ default y
config HAVE_KERNEL_LZMA
bool
+ default y
config HAVE_KERNEL_XZ
bool
+ default y
config HAVE_KERNEL_LZO
bool
+ default y
config HAVE_KERNEL_LZ4
bool
+ default y
choice
prompt "Kernel compression mode"

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,72 @@
# Kernel config based on: arch/arm64/configs/carbon_huawei_cmr_defconfig
pkgname="linux-huawei-cameron"
pkgver=4.4.23
pkgrel=0
pkgdesc="Huawei Mediapad M5 Pro kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="huawei-cameron"
url="https://kernel.org"
license="GPL2"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev python dtc"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_huawei_hi3660"
_commit="18cd8140ad09379365bcd9cb50e45662e8747834"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/JohnBergago/${_repository}/archive/${_commit}.tar.gz
$_config
01_use_linux_alpine_crosscompile.patch
03_add_compression_methods_to_Kconfig.patch
04_make_rdr_hisi_adapter_compileable.patch
05-disable-huawei-bfmr.patch
"
builddir="$srcdir/${_repository}-${_commit}"
outdir="$srcdir/../out"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
mkdir "$outdir"
cp "$srcdir/$_config" "$outdir/.config"
rm "$builddir/.config"
make ARCH="$_carch" HOSTCC="$HOSTCC" O="$outdir" oldconfig
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" O="$outdir"
}
package() {
# kernel.release
install -D "$outdir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$outdir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in Image.gz zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
}
sha512sums="1da7c7666f1bf8e3fd3931331b1ebf0ab9520fce47d44749c30abcef55856deaced0ffc74c025b323cc83eb36eb7cf9c514bc65eedbead5d40efd3e16ddc0486 linux-huawei-cameron-18cd8140ad09379365bcd9cb50e45662e8747834.tar.gz
643a78af869217af518f7857d09c5415cb59fd78260ff145eafd55d302467f448f9914029322222db84a0c6e05df420aa2af686ef8b1bff2e8108623d294806e config-huawei-cameron.aarch64
5473a038ca5703cf4119957ca3af66972c121aa66fe262a3165e5a0e5714037670a96600eedd0488150ff754ead93f43299587554ca6c05022bb55f780d1cd7a 01_use_linux_alpine_crosscompile.patch
86afc1337a34524c49e9beaad6506f7038a7413340abc473f8d209a4d3cd6ebbcf8315ae41902427edf97064742c02e2e5bb705a8bcd36d1cae19f76a509e235 03_add_compression_methods_to_Kconfig.patch
cdc60b6c829df3b014226b9cb506ed71cf005cf5fec8d4339b54a23f052465501aaa4983ec00f33ef301db2e6a70b24a30439b3f6ce8f7c00348c05d3132ec3f 04_make_rdr_hisi_adapter_compileable.patch
6e420722576111a7ba49f265a66de632631c13d1bdb67553916d2156149226526daedc8298d83a38115c0a7189497cdb92b0daa0a263a92e6093f575e855a6e5 05-disable-huawei-bfmr.patch"

File diff suppressed because it is too large Load diff