From a84393aa6d9f866121d905323196437c31d6160d Mon Sep 17 00:00:00 2001 From: Chinmaya Krishnan Mahesh Date: Wed, 17 Jan 2018 02:25:23 +0530 Subject: [PATCH] Initial support for Moto G5 Plus (potter) (#1126) --- device/device-motorola-potter/APKBUILD | 22 + device/device-motorola-potter/deviceinfo | 33 + .../linux-motorola-potter/01_prima_gcc6.patch | 16 + .../02_fix_msm_dba.patch | 13 + ...fix_rndis_ipa_trace_header_not_found.patch | 22 + .../04_fix_stmvl53l0_headers.patch | 331 ++ .../05_fix_u_f_header.patch | 58 + .../06_fix_usb_gadget_function.patch | 590 ++ device/linux-motorola-potter/APKBUILD | 97 + device/linux-motorola-potter/compiler-gcc6.h | 69 + .../config-motorola-potter.aarch64 | 5060 +++++++++++++++++ 11 files changed, 6311 insertions(+) create mode 100644 device/device-motorola-potter/APKBUILD create mode 100644 device/device-motorola-potter/deviceinfo create mode 100644 device/linux-motorola-potter/01_prima_gcc6.patch create mode 100644 device/linux-motorola-potter/02_fix_msm_dba.patch create mode 100644 device/linux-motorola-potter/03_fix_rndis_ipa_trace_header_not_found.patch create mode 100644 device/linux-motorola-potter/04_fix_stmvl53l0_headers.patch create mode 100644 device/linux-motorola-potter/05_fix_u_f_header.patch create mode 100644 device/linux-motorola-potter/06_fix_usb_gadget_function.patch create mode 100644 device/linux-motorola-potter/APKBUILD create mode 100644 device/linux-motorola-potter/compiler-gcc6.h create mode 100644 device/linux-motorola-potter/config-motorola-potter.aarch64 diff --git a/device/device-motorola-potter/APKBUILD b/device/device-motorola-potter/APKBUILD new file mode 100644 index 000000000..c0952fc1d --- /dev/null +++ b/device/device-motorola-potter/APKBUILD @@ -0,0 +1,22 @@ +# Reference: +pkgname="device-motorola-potter" +pkgdesc="Motorola Moto G5 Plus" +pkgver=0.1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="noarch" +options="!check" +depends="linux-motorola-potter mkbootimg mesa-dri-swrast" +makedepends="devicepkg-dev" +source="deviceinfo" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname +} + +sha512sums="7c38b81dd327f04acca2e8acad12ca15ab873aae2935f2ac7c66077f7c869b07d0a1502a92e9a7fcd552ac9c3817d00dbcccac27d3753207fbce199db96a739c deviceinfo" diff --git a/device/device-motorola-potter/deviceinfo b/device/device-motorola-potter/deviceinfo new file mode 100644 index 000000000..a6c836b0b --- /dev/null +++ b/device/device-motorola-potter/deviceinfo @@ -0,0 +1,33 @@ +# Reference: +# Please use double quotes only. You can source this file in shell scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Motorola Moto G5 Plus" +deviceinfo_manufacturer="Motorola" +deviceinfo_date="" +deviceinfo_dtb="" +deviceinfo_modules_initfs="" +deviceinfo_external_disk_install="false" +deviceinfo_arch="aarch64" + +# Device related +deviceinfo_keyboard="false" +deviceinfo_external_disk="true" +deviceinfo_screen_width="1080" +deviceinfo_screen_height="1920" +deviceinfo_dev_touchscreen="" +deviceinfo_dev_touchscreen_calibration="" +deviceinfo_dev_keyboard="" + +# 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 vmalloc=350M androidboot.selinux=permissive buildvariant=eng" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_qcdt="true" +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/linux-motorola-potter/01_prima_gcc6.patch b/device/linux-motorola-potter/01_prima_gcc6.patch new file mode 100644 index 000000000..0550bb310 --- /dev/null +++ b/device/linux-motorola-potter/01_prima_gcc6.patch @@ -0,0 +1,16 @@ +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 +index 14c6eadf524..e26b697f793 100644 +--- a/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c ++++ b/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c +@@ -587,9 +587,8 @@ _NV_TEMPLATE_TABLE NvTablesBuiltIn[/*TABLES_MAX*/][TABLE_ENTRIES_MAX] = { + ((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) - + (char *)&nvDefaults.tables.hwCalValues.calData),"psSlpTimeOvrHdxLNA5G"}, + {"ed",_ID_U8,SINGULAR,0,0,0, +- (((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) + +- sizeof(uint16)) - (char *)&nvDefaults.tables.hwCalValues.calData), +- "nv_TxBBFSel9MHz"}, ++ ((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) - ++ (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"}, diff --git a/device/linux-motorola-potter/02_fix_msm_dba.patch b/device/linux-motorola-potter/02_fix_msm_dba.patch new file mode 100644 index 000000000..2061842c0 --- /dev/null +++ b/device/linux-motorola-potter/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