motorola-def: new device (Moto One Hyper) (!1023)
This adds basic functionality for the Moto One Hyper. The device boots with rootfs on sd, booted by 'pmbootstrap flasher boot'. USB net works, and i can ssh in. There is no framebuffer device, but weston works with the drm backend instead of fbdev. Touchscreen support is not implemented yet, but i will update this with support when i get the chance. Most other functionality either does not seem to work yet or has not been tested (wifi, audio, modem, etc).
This commit is contained in:
parent
490443bf9b
commit
33cce38062
10 changed files with 6333 additions and 0 deletions
39
device/device-motorola-def/APKBUILD
Normal file
39
device/device-motorola-def/APKBUILD
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Contributor: ky0ko <ky0ko@disroot.org>
|
||||
# Maintainer: ky0ko <ky0ko@disroot.org>
|
||||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname="device-motorola-def"
|
||||
pkgdesc="Motorola Moto One Hyper"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!check !archcheck"
|
||||
subpackages="$pkgname-weston $pkgname-nonfree-firmware:nonfree_firmware"
|
||||
depends="postmarketos-base linux-motorola-def mkbootimg mesa-dri-swrast"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo weston.ini"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
weston() {
|
||||
install_if="$pkgname weston"
|
||||
install -Dm644 "$srcdir"/weston.ini \
|
||||
"$subpkgdir"/etc/xdg/weston/weston.ini
|
||||
}
|
||||
|
||||
nonfree_firmware() {
|
||||
pkgdesc="Nonfree firmware metapackage for Motorola One Hyper"
|
||||
depends="firmware-motorola-def"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
|
||||
sha512sums="7a799a5439fd448c58f8bdeb3ebf69e5f2c9e783e7be9ed171ce8c7756b3297f800017459e4aba336e3282cec8b1994dd3dd77f7c663858099d60c2f5ebea23b deviceinfo
|
||||
809cac74c2ea02e21359c7f37f90a0efdf90ea1d23082acff6786e6dbaa1c2b5616a4d36de751ac6c73cfa727362bc23df95b0c78bf4dd1d3441ac182372358a weston.ini"
|
35
device/device-motorola-def/deviceinfo
Normal file
35
device/device-motorola-def/deviceinfo
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Motorola One Hyper"
|
||||
deviceinfo_manufacturer="Motorola"
|
||||
deviceinfo_codename="motorola-def"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_arch="aarch64"
|
||||
|
||||
# Device related
|
||||
deviceinfo_no_framebuffer="true"
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_external_storage="true"
|
||||
deviceinfo_screen_width="1080"
|
||||
deviceinfo_screen_height="2340"
|
||||
deviceinfo_dev_touchscreen=""
|
||||
deviceinfo_dev_touchscreen_calibration=""
|
||||
deviceinfo_dev_keyboard=""
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_flash_method="fastboot"
|
||||
deviceinfo_kernel_cmdline="console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 androidboot.usbcontroller=a600000.dwc3 earlycon=msm_geni_serial,0x880000 loop.max_part=7 printk.devkmsg=on androidboot.hab.csv=0 androidboot.hab.product=def androidboot.hab.cid=50 firmware_class.path=/vendor/firmware_mnt/image buildvariant=user"
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_bootimg_qcdt="false"
|
||||
deviceinfo_bootimg_dtb_second="false"
|
||||
deviceinfo_flash_offset_base="0x00000000"
|
||||
deviceinfo_flash_offset_kernel="0x00008000"
|
||||
deviceinfo_flash_offset_ramdisk="0x01000000"
|
||||
deviceinfo_flash_offset_second="0x00f00000"
|
||||
deviceinfo_flash_offset_tags="0x00000100"
|
||||
deviceinfo_flash_pagesize="4096"
|
||||
|
4
device/device-motorola-def/weston.ini
Normal file
4
device/device-motorola-def/weston.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[core]
|
||||
backend=dri-backend.so
|
||||
[shell]
|
||||
background-image=/usr/share/wallpapers/postmarketos.jpg
|
64
device/linux-motorola-def/APKBUILD
Normal file
64
device/linux-motorola-def/APKBUILD
Normal file
|
@ -0,0 +1,64 @@
|
|||
# Contributor: ky0ko <ky0ko@disroot.org>
|
||||
# Maintainer: ky0ko <ky0ko@disroot.org>
|
||||
# Reference: <https://postmarketos.org/vendorkernel>
|
||||
|
||||
pkgname="linux-motorola-def"
|
||||
pkgver=4.14.117
|
||||
pkgrel=0
|
||||
pkgdesc="Motorola Moto One Hyper kernel fork"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
_flavor="motorola-def"
|
||||
url="https://kernel.org"
|
||||
license="GPL-2.0-only"
|
||||
options="!strip !check !tracedeps"
|
||||
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev openssl-dev clang dtc"
|
||||
|
||||
# Compiler: clang
|
||||
# kernel doesn't build with gcc6, and doesn't boot with gcc8
|
||||
# stock rom kernel is built with clang 8.0.11
|
||||
export CC="clang"
|
||||
export HOSTCC="clang"
|
||||
|
||||
# Source
|
||||
_repository="kernel-msm"
|
||||
_commit="765eaec61cf526fabdfe52cdea1ef6aa9415b993"
|
||||
_config="config-motorola-def.aarch64"
|
||||
source="
|
||||
$pkgname-$_commit.tar.gz::https://github.com/MotorolaMobilityLLC/$_repository/archive/$_commit.tar.gz
|
||||
qcom-fix-trace-include-paths.patch
|
||||
dsi-staging-fix-duplicate-static.patch
|
||||
fix-hdcp-case-label.patch
|
||||
fix_ipa_buf_size_mismatch.patch
|
||||
$_config
|
||||
"
|
||||
builddir="$srcdir/$_repository-$_commit"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
REPLACE_GCCH=0 downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
|
||||
}
|
||||
|
||||
build() {
|
||||
unset LDFLAGS
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
DTC=dtc CFLAGS_MODULE="-fno-pic" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||
}
|
||||
|
||||
package() {
|
||||
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
|
||||
|
||||
# Install kernel modules
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" \
|
||||
INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 \
|
||||
modules_install
|
||||
}
|
||||
|
||||
sha512sums="80fa3677d51cee6e64d7edaf56448bcc3b4f1c0fa56679a0e93986f7d322ce291c65247793dea23aeadaf15308c9b9db7a8e82a0f971e2c41f9dc589ce6d2c96 linux-motorola-def-765eaec61cf526fabdfe52cdea1ef6aa9415b993.tar.gz
|
||||
033f71f37cbf2e2b7442e5a8466b0b5f3e07b119a584e7e6768c9e4a6253dc8e053df8277c2c9271c203562b4da9d2a7e7f4200b00709ab8758f18262df5864f qcom-fix-trace-include-paths.patch
|
||||
45cd1dded5c56c93aa80a016ec9a96098633d6b38a02f2614cc0d96737409c24230d22eaaf8a244ce5d2eef07fb34cddcb06aea87e4b7805138cb5ac8c62f7cf dsi-staging-fix-duplicate-static.patch
|
||||
9b459f035f4277172265888a810af53b82de94df700f3dc79398bec585a9b85deed3a36634ae88482fdef9b276b2aa1189386e8646184375cd3042f08bd7acdd fix-hdcp-case-label.patch
|
||||
592d87cbb9532e0311a9d23bc10bdbae9859709993e7b88a7202cd7023e8cc3fcdaa1810a2171771222df2ead44b8de048cb5b10b5088f44607d7c7c5b15da1b fix_ipa_buf_size_mismatch.patch
|
||||
5b10e36e0422550760be496a679eb8a048c6cb0958c4fc35e0642c1c952be5490c0ed6793f0287c52dcb0aafae701294a725a145fc4ab78e65a699a8502e935e config-motorola-def.aarch64"
|
6034
device/linux-motorola-def/config-motorola-def.aarch64
Normal file
6034
device/linux-motorola-def/config-motorola-def.aarch64
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
drivers/gpu/drm/msm/dsi-staging/dsi_display_mot_ext.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff a/drivers/gpu/drm/msm/dsi-staging/dsi_display_mot_ext.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display_mot_ext.c
|
||||
--- a/drivers/gpu/drm/msm/dsi-staging/dsi_display_mot_ext.c
|
||||
+++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display_mot_ext.c
|
||||
@@ -40,1 +40,1 @@
|
||||
-static static struct alarm *g_wakeup_timer = NULL;
|
||||
+static struct alarm *g_wakeup_timer = NULL;
|
||||
--
|
||||
|
24
device/linux-motorola-def/fix-hdcp-case-label.patch
Normal file
24
device/linux-motorola-def/fix-hdcp-case-label.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
diff --git a/drivers/gpu/drm/msm/sde_hdcp_2x.c b/drivers/gpu/drm/msm/sde_hdcp_2x.c
|
||||
index 01e5e2c9e516..10aca3e30049 100644
|
||||
--- a/drivers/gpu/drm/msm/sde_hdcp_2x.c
|
||||
+++ b/drivers/gpu/drm/msm/sde_hdcp_2x.c
|
||||
@@ -418,16 +418,14 @@ static void sde_hdcp_2x_cleanup_work(struct kthread_work *work)
|
||||
static u8 sde_hdcp_2x_stream_type(u8 min_enc_level)
|
||||
{
|
||||
u8 stream_type = 0;
|
||||
- u8 const hdcp_min_enc_level_0 = 0, hdcp_min_enc_level_1 = 1,
|
||||
- hdcp_min_enc_level_2 = 2;
|
||||
u8 const stream_type_0 = 0, stream_type_1 = 1;
|
||||
|
||||
switch (min_enc_level) {
|
||||
- case hdcp_min_enc_level_0:
|
||||
- case hdcp_min_enc_level_1:
|
||||
+ case 0:
|
||||
+ case 1:
|
||||
stream_type = stream_type_0;
|
||||
break;
|
||||
- case hdcp_min_enc_level_2:
|
||||
+ case 2:
|
||||
stream_type = stream_type_1;
|
||||
break;
|
||||
default:
|
13
device/linux-motorola-def/fix_ipa_buf_size_mismatch.patch
Normal file
13
device/linux-motorola-def/fix_ipa_buf_size_mismatch.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c
|
||||
index ce536940a3bc..ea9f19880eb5 100644
|
||||
--- a/drivers/platform/msm/ipa/ipa_v3/ipa.c
|
||||
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c
|
||||
@@ -5934,7 +5934,7 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf,
|
||||
if (sizeof(dbg_buff) < count + 1)
|
||||
return -EFAULT;
|
||||
|
||||
- missing = copy_from_user(dbg_buff, buf, count);
|
||||
+ missing = copy_from_user(dbg_buff, buf, sizeof(buf));
|
||||
|
||||
if (missing) {
|
||||
IPAERR("Unable to copy data from user\n");
|
85
device/linux-motorola-def/qcom-fix-trace-include-paths.patch
Normal file
85
device/linux-motorola-def/qcom-fix-trace-include-paths.patch
Normal file
|
@ -0,0 +1,85 @@
|
|||
---
|
||||
drivers/media/platform/msm/camera/cam_utils/cam_trace.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff a/drivers/media/platform/msm/camera/cam_utils/cam_trace.h b/drivers/media/platform/msm/camera/cam_utils/cam_trace.h
|
||||
--- a/drivers/media/platform/msm/camera/cam_utils/cam_trace.h
|
||||
+++ b/drivers/media/platform/msm/camera/cam_utils/cam_trace.h
|
||||
@@ -89,1 +89,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/media/platform/msm/camera/cam_utils/
|
||||
--
|
||||
|
||||
---
|
||||
drivers/hid/hid-trace.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff a/drivers/hid/hid-trace.h b/drivers/hid/hid-trace.h
|
||||
--- a/drivers/hid/hid-trace.h
|
||||
+++ b/drivers/hid/hid-trace.h
|
||||
@@ -20,1 +20,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/hid/
|
||||
--
|
||||
|
||||
---
|
||||
drivers/media/platform/msm/camera/cam_utils/cam_trace.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa_trace.h b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa_trace.h
|
||||
--- a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa_trace.h
|
||||
+++ b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa_trace.h
|
||||
@@ -89,1 +89,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_clients/
|
||||
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h
|
||||
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h
|
||||
@@ -89,1 +89,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_v3/
|
||||
--- a/drivers/gpu/msm/kgsl_trace.h
|
||||
+++ b/drivers/gpu/msm/kgsl_trace.h
|
||||
@@ -89,1 +89,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/gpu/msm/
|
||||
--- a/drivers/gpu/msm/adreno_trace.h
|
||||
+++ b/drivers/gpu/msm/adreno_trace.h
|
||||
@@ -20,1 +20,1 @@
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/gpu/msm/
|
||||
--
|
||||
|
||||
|
||||
From 371415e897a4cab4fd823a8d496eb5867591dd91 Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Tue, 27 Nov 2018 14:22:17 -0800
|
||||
Subject: [PATCH 1/2] clk: qcom: mdss: fix in-tree build
|
||||
|
||||
Without an explicit include path, when doing an in-tree build, I get
|
||||
|
||||
```
|
||||
In file included from drivers/clk/qcom/mdss/mdss_pll_trace.h:116,
|
||||
from drivers/clk/qcom/mdss/mdss-dsi-pll-10nm.c:24:
|
||||
./include/trace/define_trace.h:88:42: fatal error: ./mdss_pll_trace.h: No such file or directory
|
||||
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
|
||||
```
|
||||
|
||||
Adding the full path fixes this.
|
||||
---
|
||||
drivers/clk/qcom/mdss/mdss_pll_trace.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/qcom/mdss/mdss_pll_trace.h b/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
index cd4fda6c7d30..1c7225a46b23 100644
|
||||
--- a/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
+++ b/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
@@ -112,5 +112,5 @@ TRACE_EVENT(mdss_pll_trace_counter,
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/clk/qcom/mdss
|
||||
#include <trace/define_trace.h>
|
||||
--
|
||||
2.17.1
|
||||
|
23
firmware/firmware-motorola-def/APKBUILD
Normal file
23
firmware/firmware-motorola-def/APKBUILD
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Contributor: ky0ko <ky0ko@disroot.org>
|
||||
# Maintainer: ky0ko <ky0ko@disroot.org>
|
||||
pkgname=firmware-motorola-def
|
||||
pkgver=1
|
||||
pkgrel=0
|
||||
pkgdesc="Firmware for Motorola One Hyper"
|
||||
url="https://github.com/goshhhy/motorola-def-firmware"
|
||||
arch="aarch64"
|
||||
license="proprietary"
|
||||
options="!check !strip !archcheck"
|
||||
|
||||
# Sources
|
||||
_commit="8575cc1ad407a37126beb625a7d53581af02cfb4"
|
||||
source="https://github.com/goshhhy/motorola-def-firmware/archive/$_commit.tar.gz"
|
||||
|
||||
package() {
|
||||
cd "$srcdir/motorola-def-firmware-$_commit/files"
|
||||
for _i in *; do
|
||||
install -Dm644 $_i "$pkgdir"/lib/firmware/$_i
|
||||
done
|
||||
}
|
||||
|
||||
sha512sums="eb9840066863775a2d4edd06849438be41cfa765b557bab30d3ef69b1c1d715ec67b876d4dff18a7fb29a6aaeccab78702da3ce137876e087f162bf669b68766 8575cc1ad407a37126beb625a7d53581af02cfb4.tar.gz"
|
Loading…
Reference in a new issue