zte-p731a20: new device (ZTE Blade AF3) (!325)

[ci:skip-build]: already successfully built in CI
This commit is contained in:
km2 2019-04-18 16:32:13 +05:00 committed by Oliver Smith
parent c6e854b186
commit 1788bb25a3
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
10 changed files with 3518 additions and 0 deletions

View file

@ -0,0 +1,25 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-zte-p731a20"
pkgdesc="ZTE Blade AF3"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-zte-p731a20 mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev"
source="deviceinfo
initfs-hook.sh"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="e12c82d91d3dc793f832a5c7d5b99d8c9fd70e28b28d6d8ad95b53f1c89197cbbb4d2ebf14ba76bb8fafc654e361e71ec63b21b2d953d8a7c85856cff24dc3ae deviceinfo
46c58ff11a1f6cecc3f450f462c9a2b01d2a651f933a796c8a9c2e72f5fba0a0fe876429b5e7dad2fbc64fb056150d56929cd932b39053bed64b389c825bac0d initfs-hook.sh"

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="ZTE Blade AF3"
deviceinfo_manufacturer="ZTE"
deviceinfo_codename="zte-p731a20"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="480"
deviceinfo_screen_height="800"
deviceinfo_dev_touchscreen=""
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyS1,115200n8"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
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="2048"

View file

@ -0,0 +1,5 @@
#!/bin/sh
# enable display
echo 0 0 > /sys/class/graphics/fb0/pan
echo 0 0 > /sys/class/graphics/fb0/pan

View file

@ -0,0 +1,29 @@
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index f89515a..2bb8cac 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 0b13a72..8bf0a5a 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);

View file

@ -0,0 +1,73 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/sp7731gea-dt_defconfig
pkgname="linux-zte-p731a20"
pkgver=3.10.17
pkgrel=0
pkgdesc="ZTE_P731A20 kernel"
arch="armv7"
_carch="arm"
_flavor="zte-p731a20"
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 dtbtool"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_zte_P731A20"
_commit="a1b2e761517f0e2bed0dd5e1a94053d7c648614d"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/blade-af3/${_repository}/archive/${_commit}.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
00_return_address.patch
fix_cross_compile.patch
qcom,msm-id_fix.patch"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
CFLAGS_MODULE=-fno-pic
# Generate master DTB (deviceinfo_bootimg_qcdt)
dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
install -Dm644 "$builddir/arch/$_carch/boot/zImage" \
"$pkgdir/boot/vmlinuz-$_flavor"
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
echo "--[ Installing modules ]--"
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" \
INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 modules_install
}
sha512sums="e29e9b242c235fe48278643a5ee4bb487c6a7cab09b23a16f796b945371da5505cdd3791b322837d29df4a401a91373f0a65c01794ad4576b2ab925487cdc64d linux-zte-p731a20-a1b2e761517f0e2bed0dd5e1a94053d7c648614d.tar.gz
ed722be637b335cdb5b2a7a231a5253235c250cd904506808bc99a560db2b91f61b52104d4943164f2223afac5d50df23222ada16d4ed3affdd014e97ff555eb config-zte-p731a20.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
c40eaa11547f5bc2b1ff965506bdfe3015ff16e4b5ad9ccb3b8134ceafd1d32407c4ef2b213e02e036ce1e9bdcbfe768dff7d4b054bec77705a176c1f783b6f5 00_return_address.patch
2bedb0af8a23f5febc5f23a41c91174bffa5cb3b9af699fd61c86089a5bead77a08aca23daa62a3b7e93845e9cf86a1f5cc2a5fb4c4a56af09cf5befa2287d31 fix_cross_compile.patch
0b3ae537793ebd6d24dfca9ec81674fc14b2aece4592bf2700795382f059501285a3e673c02a7114e8239040d41e096b10b819173f14ef837346ed60b0f55574 qcom,msm-id_fix.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
--- a/Makefile 2019-04-03 14:12:27.611906000 +0500
+++ b/Makefile 2019-04-04 14:15:17.691566426 +0500
@@ -193,7 +193,7 @@
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
ARCH =arm
-CROSS_COMPILE =arm-eabi-
+#CROSS_COMPILE =arm-eabi-
# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -0,0 +1,11 @@
diff -urN a/arch/arm/boot/dts/sprd-scx35_sp7731gea.dts b/arch/arm/boot/dts/sprd-scx35_sp7731gea.dts
--- a/arch/arm/boot/dts/sprd-scx35_sp7731gea.dts 2019-04-17 15:09:15.184868111 +0500
+++ b/arch/arm/boot/dts/sprd-scx35_sp7731gea.dts 2019-04-17 14:56:57.613786000 +0500
@@ -33,6 +33,7 @@
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
sprd,sc-id = <8830 1 0x20000>;
+ qcom,msm-id = <8830 1 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;