From 606b723450e4665addcfcebdc25a52c26ded4ab8 Mon Sep 17 00:00:00 2001 From: Julian Braha Date: Sat, 18 Apr 2020 18:32:11 -0400 Subject: [PATCH] motorola-ali: new device (Motorola Moto G6) (MR 1071) [ci:skip-build] already built on CI in MR --- device/testing/device-motorola-ali/APKBUILD | 29 + device/testing/device-motorola-ali/deviceinfo | 30 + device/testing/device-motorola-ali/directfbrc | 1 + device/testing/device-motorola-ali/fb.modes | 7 + .../device-motorola-ali/initfs-hook.sh | 7 + .../01_maserati-fix-gcc6-compile.patch | 93 + .../linux-motorola-ali/01_prima_gcc6.patch | 17 + .../linux-motorola-ali/02_fix_msm_dba.patch | 13 + ...fix_rndis_ipa_trace_header_not_found.patch | 22 + .../04_fix_stmvl53l0_headers.patch | 331 ++ device/testing/linux-motorola-ali/APKBUILD | 68 + .../config-motorola-ali.armv7 | 4929 +++++++++++++++++ .../fix-include-msm_camera_i2c.patch | 18 + .../fix-include-msm_isp.patch | 12 + .../testing/linux-motorola-ali/fix_fb.patch | 76 + .../testing/linux-motorola-ali/fix_fb_h.patch | 10 + .../fix_focaltech_recursive_dependency.patch | 9 + .../linux-motorola-ali/fix_mdp_ctrl_off.patch | 10 + .../linux-motorola-ali/fix_mdss_overlay.patch | 10 + .../linux-motorola-ali/fix_msm_dba.patch | 13 + .../linux-motorola-ali/fix_symlink_gsi.patch | 10 + .../linux-motorola-ali/fix_symlink_midi.patch | 10 + .../linux-motorola-ali/fix_symlink_mtp.patch | 16 + .../fix_symlink_rndis.patch | 10 + 24 files changed, 5751 insertions(+) create mode 100644 device/testing/device-motorola-ali/APKBUILD create mode 100644 device/testing/device-motorola-ali/deviceinfo create mode 100644 device/testing/device-motorola-ali/directfbrc create mode 100644 device/testing/device-motorola-ali/fb.modes create mode 100644 device/testing/device-motorola-ali/initfs-hook.sh create mode 100644 device/testing/linux-motorola-ali/01_maserati-fix-gcc6-compile.patch create mode 100644 device/testing/linux-motorola-ali/01_prima_gcc6.patch create mode 100644 device/testing/linux-motorola-ali/02_fix_msm_dba.patch create mode 100644 device/testing/linux-motorola-ali/03_fix_rndis_ipa_trace_header_not_found.patch create mode 100644 device/testing/linux-motorola-ali/04_fix_stmvl53l0_headers.patch create mode 100644 device/testing/linux-motorola-ali/APKBUILD create mode 100644 device/testing/linux-motorola-ali/config-motorola-ali.armv7 create mode 100644 device/testing/linux-motorola-ali/fix-include-msm_camera_i2c.patch create mode 100644 device/testing/linux-motorola-ali/fix-include-msm_isp.patch create mode 100644 device/testing/linux-motorola-ali/fix_fb.patch create mode 100644 device/testing/linux-motorola-ali/fix_fb_h.patch create mode 100644 device/testing/linux-motorola-ali/fix_focaltech_recursive_dependency.patch create mode 100644 device/testing/linux-motorola-ali/fix_mdp_ctrl_off.patch create mode 100644 device/testing/linux-motorola-ali/fix_mdss_overlay.patch create mode 100644 device/testing/linux-motorola-ali/fix_msm_dba.patch create mode 100644 device/testing/linux-motorola-ali/fix_symlink_gsi.patch create mode 100644 device/testing/linux-motorola-ali/fix_symlink_midi.patch create mode 100644 device/testing/linux-motorola-ali/fix_symlink_mtp.patch create mode 100644 device/testing/linux-motorola-ali/fix_symlink_rndis.patch diff --git a/device/testing/device-motorola-ali/APKBUILD b/device/testing/device-motorola-ali/APKBUILD new file mode 100644 index 000000000..c1a3e9e77 --- /dev/null +++ b/device/testing/device-motorola-ali/APKBUILD @@ -0,0 +1,29 @@ +# Contributor: Julian Braha +# Reference: +pkgname=device-motorola-ali +pkgdesc="Motorola Moto G6" +pkgver=0.1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="armv7" +options="!check !archcheck" +depends="postmarketos-base linux-motorola-ali mkbootimg mesa-dri-swrast msm-fb-refresher mdss-fb-init-hack" +makedepends="devicepkg-dev" +source="deviceinfo initfs-hook.sh directfbrc fb.modes" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/fb.modes "$pkgdir"/etc/fb.modes + install -Dm644 "$srcdir"/directfbrc "$pkgdir"/etc/directfbrc +} + + +sha512sums="2ef6a7490b157f16afe11121c1b5d584bfd357a218bff2d04dac6b212dc3a978cf3721c96bd04bc612d079ae3e0f6793c864be2fa89fd417242982b808981278 deviceinfo +977537b59e0f89d0db475108baae1d93a6678569ec4d7ab7c909562ebea7d645efb6a73b509b3e37369c1c556a8760cd9f46ba4e9bbb86e400cabcc0c2960230 initfs-hook.sh +3db3ec596e159be926ea2b5b2496c18e9bc7be24a64a232a56c89a0c9ee710aa2efb2b6fa9fc08efa34759e8242e6c629d08a4ce688ec8aa125830717c191515 directfbrc +e8ee37f49b360e06f7b5d54a93fcd2a7b3261436b2a228e8457a5c44fb52510f6173332155701a9d8ed435466732921ea5836aed73f1e7bc4049635f5a71fb31 fb.modes" diff --git a/device/testing/device-motorola-ali/deviceinfo b/device/testing/device-motorola-ali/deviceinfo new file mode 100644 index 000000000..e14dfc039 --- /dev/null +++ b/device/testing/device-motorola-ali/deviceinfo @@ -0,0 +1,30 @@ +# Reference: +# Please use double quotes only. You can source this file in shell scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Motorola Moto G6" +deviceinfo_manufacturer="Motorola" +deviceinfo_codename="motorola-ali" +deviceinfo_year="2018" +deviceinfo_dtb="" +deviceinfo_modules_initfs="" +deviceinfo_arch="armv7" + +# Device related +deviceinfo_keyboard="false" +deviceinfo_external_storage="false" +deviceinfo_screen_width="1080" +deviceinfo_screen_height="2160" + +# Bootloader related +deviceinfo_flash_method="fastboot" +deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 vmalloc=400M buildvariant=user" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_qcdt="false" +deviceinfo_bootimg_dtb_second="false" +deviceinfo_flash_offset_base="0x80000000" +deviceinfo_flash_offset_kernel="0x00008000" +deviceinfo_flash_offset_ramdisk="0x01000000" +deviceinfo_flash_offset_second="0x00f00000" +deviceinfo_flash_offset_tags="0x00000100" +deviceinfo_flash_pagesize="2048" diff --git a/device/testing/device-motorola-ali/directfbrc b/device/testing/device-motorola-ali/directfbrc new file mode 100644 index 000000000..2f95682a6 --- /dev/null +++ b/device/testing/device-motorola-ali/directfbrc @@ -0,0 +1 @@ +pixelformat=ARGB diff --git a/device/testing/device-motorola-ali/fb.modes b/device/testing/device-motorola-ali/fb.modes new file mode 100644 index 000000000..3b52e3c23 --- /dev/null +++ b/device/testing/device-motorola-ali/fb.modes @@ -0,0 +1,7 @@ +mode "1080x2160-60" + # D: 156.104 MHz, H: 131.180 kHz, V: 60.009 Hz + geometry 1080 2160 1080 2160 16 + timings 6406 53 53 24 1 4 1 + accel false + rgba 8/0,8/8,8/16,8/24 +endmode diff --git a/device/testing/device-motorola-ali/initfs-hook.sh b/device/testing/device-motorola-ali/initfs-hook.sh new file mode 100644 index 000000000..0befe7533 --- /dev/null +++ b/device/testing/device-motorola-ali/initfs-hook.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# enable touchscreen +echo 1 > /sys/devices/soc/78b7000.i2c/i2c-3/3-0020/drv_irq + +# fixes the "boot to black screen" issue +echo 0 0 > /sys/class/graphics/fb0/pan diff --git a/device/testing/linux-motorola-ali/01_maserati-fix-gcc6-compile.patch b/device/testing/linux-motorola-ali/01_maserati-fix-gcc6-compile.patch new file mode 100644 index 000000000..4dcc8c941 --- /dev/null +++ b/device/testing/linux-motorola-ali/01_maserati-fix-gcc6-compile.patch @@ -0,0 +1,93 @@ +From 51a1339a3206ed275b8021958a9a8d237322f9fa Mon Sep 17 00:00:00 2001 +From: NeKit +Date: Sun, 10 Dec 2017 14:41:20 +0300 +Subject: [PATCH] Fix compile errors with gcc6 on postmarketOS + +Change-Id: I1f426c864a0377b33b27da5cc6476f6ff888b6cb +--- + arch/arm/include/asm/ftrace.h | 2 +- + arch/arm/kernel/return_address.c | 5 ----- + include/linux/i2c/twl.h | 2 +- + kernel/timeconst.pl | 2 +- + scripts/mod/elf.h | 5 ----- + 5 files changed, 3 insertions(+), 13 deletions(-) + +diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h +index f89515adac6..2bb8cac28b9 100644 +--- a/arch/arm/include/asm/ftrace.h ++++ b/arch/arm/include/asm/ftrace.h +@@ -45,7 +45,7 @@ void *return_address(unsigned int); + + #else + +-extern inline void *return_address(unsigned int level) ++static inline void *return_address(unsigned int level) + { + return NULL; + } +diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c +index 0b13a72f855..8bf0a5abec9 100644 +--- a/arch/arm/kernel/return_address.c ++++ b/arch/arm/kernel/return_address.c +@@ -62,11 +62,6 @@ void *return_address(unsigned int level) + #warning "TODO: return_address should use unwind tables" + #endif + +-void *return_address(unsigned int level) +-{ +- return NULL; +-} +- + #endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */ + + EXPORT_SYMBOL_GPL(return_address); +diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h +index 947543a0fba..ec7c8855117 100644 +--- a/include/linux/i2c/twl.h ++++ b/include/linux/i2c/twl.h +@@ -735,7 +735,7 @@ static inline int twl4030_remove_script(u8 flags) { return -EINVAL; } + #ifdef CONFIG_TWL6030_POWER + extern void twl6030_power_init(struct twl4030_power_data *power_data); + #else +-extern inline void twl6030_power_init(struct twl4030_power_data *power_data) { } ++static inline void twl6030_power_init(struct twl4030_power_data *power_data) { } + #endif + + struct twl4030_codec_audio_data { +diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl +index eb51d76e058..2ccb8fb87a1 100644 +--- a/kernel/timeconst.pl ++++ b/kernel/timeconst.pl +@@ -370,7 +370,7 @@ if ($hz eq '--can') { + } + + @val = @{$canned_values{$hz}}; +- if (!defined(@val)) { ++ if (!@val) { + @val = compute_values($hz); + } + output($hz, @val); +diff --git a/scripts/mod/elf.h b/scripts/mod/elf.h +index aba4d0c4c1c..f898d3ee28b 100644 +--- a/scripts/mod/elf.h ++++ b/scripts/mod/elf.h +@@ -22,8 +22,6 @@ + + /* #include */ + +-__BEGIN_DECLS +- + /* Standard ELF types. */ + + #include +@@ -2507,7 +2505,4 @@ typedef Elf32_Addr Elf32_Conflict; + /* Keep this the last entry. */ + #define R_V850_NUM 25 + +- +-__END_DECLS +- + #endif /* elf.h */ +-- +2.13.2 + diff --git a/device/testing/linux-motorola-ali/01_prima_gcc6.patch b/device/testing/linux-motorola-ali/01_prima_gcc6.patch new file mode 100644 index 000000000..80cd60bf4 --- /dev/null +++ b/device/testing/linux-motorola-ali/01_prima_gcc6.patch @@ -0,0 +1,17 @@ +diff --git a/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c b/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c +@@ -582,8 +582,7 @@ + (char *)&nvDefaults.tables.hwCalValues.calData),"psSlpTimeOvrHdxLNA5G"}, + {"ed",_ID_U8,SINGULAR,0,0,0, + ((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) - +- (char *)&nvDefaults.tables.hwCalValues.calData) + sizeof(uint16), +- "nv_TxBBFSel9MHz"}, ++ (char *)&nvDefaults.tables.hwCalValues.calData),"nv_TxBBFSel9MHz"}, + {"ee",_ID_U8,SINGULAR,0,0,0, + ((char *)&(nvDefaults.tables.hwCalValues.calData.hwParam2) - + (char *)&nvDefaults.tables.hwCalValues.calData),"hwParam2"}, +@@ -839,4 +838,4 @@ + int getTableNoOfFields(int tblIdx) + { + return tableNoOfFieldArray[tblIdx]; +-} ++} diff --git a/device/testing/linux-motorola-ali/02_fix_msm_dba.patch b/device/testing/linux-motorola-ali/02_fix_msm_dba.patch new file mode 100644 index 000000000..2061842c0 --- /dev/null +++ b/device/testing/linux-motorola-ali/02_fix_msm_dba.patch @@ -0,0 +1,13 @@ +diff --git a/drivers/video/msm/msm_dba/msm_dba.c b/drivers/video/msm/msm_dba/msm_dba.c +index cc6512a..eb073a7 100644 +--- a/drivers/video/msm/msm_dba/msm_dba.c ++++ b/drivers/video/msm/msm_dba/msm_dba.c +@@ -22,7 +22,7 @@ + #include + + #include