New device: Nexus 5X (LG Bullhead) (#1222)

This commit is contained in:
Bart Ribbers 2018-02-20 21:24:45 +01:00 committed by Oliver Smith
parent 2a9c1da46c
commit a3676b1bbc
8 changed files with 4476 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-lg-bullhead"
pkgdesc="Google Nexus 5X"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="noarch"
options="!check"
depends="linux-lg-bullhead mkbootimg mesa-dri-swrast libsparse msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="8af915fed8fe29d279148077c3f71924fac31250990b886bfafc034d2c0905f116618ef3af4c4e993dffa4325273e5119efc388a3c17f1130b753c76ee2139b9 deviceinfo"

View File

@ -0,0 +1,34 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Google Nexus 5X"
deviceinfo_manufacturer="LG"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_external_disk_install="false"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_disk="false"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
deviceinfo_dev_touchscreen="/dev/input/event0"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
deviceinfo_msm_refresher="true"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.hardware=bullhead boot_cpus=0-5 lpm_levels.sleep_disabled=1 msm_poweroff.download_mode=0 buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"
deviceinfo_flash_pagesize="4096"
deviceinfo_flash_sparse=true

View File

@ -0,0 +1,88 @@
# Kernel config based on: arch/arm64/configs/lineageos_bullhead_defconfig
pkgname="linux-lg-bullhead"
pkgver=3.10.108
pkgrel=0
pkgdesc="Google Nexus 5X kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="lg-bullhead"
url="https://kernel.org"
license="GPL2"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev xz"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="bullhead"
_commit="57351a6494f82cda87c697e10afb98b7f3bd28a2"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/franciscofranco/${_repository}/archive/${_commit}.tar.gz
$_config
compiler-gcc6.h
static-inline.patch
driver-fix.patch
undefined-screen_info.patch
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
# Remove -Werror from all makefiles
local i
local makefiles="$(find . -type f -name Makefile)
$(find . -type f -name Kbuild)"
for i in $makefiles; do
sed -i 's/-Werror-/-W/g' "$i"
sed -i 's/-Werror//g' "$i"
done
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
cp "$srcdir"/$_config "$builddir"/.config
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in 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="f34e79b5c80e6dcb2de4a85ec5a59b837338b55c4fef5ac5c6dfaf0d78220a016397442032fbf340eeead1201dd01feeff660adfe3406fdddf66832e59416898 linux-lg-bullhead-57351a6494f82cda87c697e10afb98b7f3bd28a2.tar.gz
7e49fa92edfe2057f3454909ad2bc7e643c8372fbb64003ec66581896e6497cedd506a721df436f10f741d30cceee7c1e8a9fbe215755deae575bb2e2b5bb757 config-lg-bullhead.aarch64
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
ad77ff2bea83e603bfdbd6bdae7a15f8e8d4a4a005a6ad26b6d8872767bb80b41cc2c0df228d6978ad0bd9e84486bea98a178478b93948e3e37794755e136bd6 static-inline.patch
64060a1b42743b398feb7b9b05259ff5bc8a3607c9e357d9c1f57c9c0994b433a2fc0c2697a34c71b78ca4096f06ef18e1f5575c4a6a3e93d3c39066ee88d418 driver-fix.patch
f05386bd27c61e579e69b6ece42b99438ae6da67b8321eec3e4b408a06ff9bdc35cb354fe6dd66751c9118263463f91eb8c250e82532ec4698ea61ac3371c558 undefined-screen_info.patch"

View File

@ -0,0 +1,69 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
diff --git a/drivers/media/platform/msm/vidc/hfi_packetization.c b/drivers/media/platform/msm/vidc/hfi_packetization.c
index f605d6ab..4355d111 100644
--- a/drivers/media/platform/msm/vidc/hfi_packetization.c
+++ b/drivers/media/platform/msm/vidc/hfi_packetization.c
@@ -324,7 +324,7 @@ int create_pkt_cmd_sys_ping(struct hfi_cmd_sys_ping_packet *pkt)
return rc;
}
-inline int create_pkt_cmd_sys_session_init(
+static inline int create_pkt_cmd_sys_session_init(
struct hfi_cmd_sys_session_init_packet *pkt,
struct hal_session *session,
u32 session_domain, u32 session_codec)

View File

@ -0,0 +1,46 @@
diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h
index e2b39852..c245ea31 100644
--- a/lib/mpi/mpi-inline.h
+++ b/lib/mpi/mpi-inline.h
@@ -30,7 +30,7 @@
#define G10_MPI_INLINE_H
#ifndef G10_MPI_INLINE_DECL
-#define G10_MPI_INLINE_DECL extern inline
+#define G10_MPI_INLINE_DECL static inline
#endif
G10_MPI_INLINE_DECL mpi_limb_t
diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h
index 60cf7656..91ef8acd 100644
--- a/lib/mpi/mpi-internal.h
+++ b/lib/mpi/mpi-internal.h
@@ -168,20 +168,24 @@ void mpi_rshift_limbs(MPI a, unsigned int count);
int mpi_lshift_limbs(MPI a, unsigned int count);
/*-- mpihelp-add.c --*/
+#ifndef __GNUC__
mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
mpi_size_t s1_size, mpi_limb_t s2_limb);
-mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
- mpi_ptr_t s2_ptr, mpi_size_t size);
mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
mpi_ptr_t s2_ptr, mpi_size_t s2_size);
+#endif
+mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+ mpi_ptr_t s2_ptr, mpi_size_t size);
/*-- mpihelp-sub.c --*/
+#ifndef __GNUC__
mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
mpi_size_t s1_size, mpi_limb_t s2_limb);
-mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
- mpi_ptr_t s2_ptr, mpi_size_t size);
mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
mpi_ptr_t s2_ptr, mpi_size_t s2_size);
+#endif
+mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+ mpi_ptr_t s2_ptr, mpi_size_t size);
/*-- mpihelp-cmp.c --*/
int mpihelp_cmp(mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size);

View File

@ -0,0 +1,27 @@
As found here:
http://linux-kernel.2935.n7.nabble.com/PATCH-arm64-kernel-need-extern-variable-screen-info-for-related-driver-using-td652444.html
---
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index efa2123a..4beccf05 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -591,6 +591,17 @@ const struct seq_operations cpuinfo_op = {
.show = c_show
};
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
+struct screen_info screen_info = {
+ .orig_video_lines = 30,
+ .orig_video_cols = 80,
+ .orig_video_mode = 0,
+ .orig_video_ega_bx = 0,
+ .orig_video_isVGA = 1,
+ .orig_video_points = 8
+};
+#endif
+
void arch_setup_pdev_archdata(struct platform_device *pdev)
{
pdev->archdata.dma_mask = DMA_BIT_MASK(32);