sony-taoshan: add Sony Xperia L

This commit is contained in:
Piotr Halama 2018-11-21 07:53:26 +00:00 committed by Oliver Smith
parent 1358b1a91d
commit 87434c2062
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
14 changed files with 4441 additions and 0 deletions

View file

@ -0,0 +1 @@
/logo.rle

View file

@ -0,0 +1 @@
/usr/sbin/sony-taoshan-screen-enlightener

View file

@ -0,0 +1,43 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-sony-taoshan"
pkgdesc="Sony Xperia L"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armhf"
options="!check !archcheck"
depends="postmarketos-base linux-sony-taoshan mkbootimg msm-fb-refresher mesa-dri-swrast"
makedepends="devicepkg-dev"
source="
deviceinfo
sony-taoshan-screen-enlightener
fb.modes
40-boot-logo.files
50-screen-enlightener.files
initfs-hook.sh
logo.rle
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm544 "$srcdir"/fb.modes "$pkgdir"/etc/fb.modes
install -Dm755 "$srcdir"/sony-taoshan-screen-enlightener "$pkgdir"/usr/sbin/sony-taoshan-screen-enlightener
install -Dm644 "$srcdir"/40-boot-logo.files "$pkgdir"/etc/postmarketos-mkinitfs/files/40-boot-logo.files
install -Dm644 "$srcdir"/50-screen-enlightener.files "$pkgdir"/etc/postmarketos-mkinitfs/files/50-screen-enlightener.files
install -Dm644 "$srcdir"/initfs-hook.sh "$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
install -Dm644 "$srcdir"/logo.rle "$pkgdir"/
}
sha512sums="19b5740953c2732e35906982d8f3358c57181e3906f3dab6d92c063aa416bf1b12854a9fe50cc374ae1bc2f06304c8aa9a15b28e587e4b42e44d4432e4d82c80 deviceinfo
fff18ea9ccdabd2d6290755d716cb5444f54ce350f3ddd6ae0f23b78539b64d92b9e81a804b290c4c89bca318cfaa5930658ca62dc60cb0ad60033d516ab6aed sony-taoshan-screen-enlightener
72b830759c11c1d15387bff6cd9556ddac6aafa168f86ed3d3cb461f67f1492ff0b779b4c4141b6ce62a3ae02e8073bda6e19cfcf73b18b11aac99dbec8099f4 fb.modes
153f8549244ed2c053aee3f2560df241f7c133f24032d889a2fce112015773fc32d3d081a9e09755536232462a3668dc8798851f2f6a48a16f66cfdd85d317a4 40-boot-logo.files
c47c000a34d3d0129d7dc626cbcefa736e5ecb822a9e9b4af48ce1f5a1365a6c8b611995bc82d94f2b8bca546c2e17539757b6e2b26d3d5c0aae5c5515f647f1 50-screen-enlightener.files
b540a85692feb0fb37f9f52f3b12b8cca6ad32469b7359464411b2d06ab896938466eef18e81fcc97a88f0aa1837cefd442389db14bc8d34c009b774c4915de4 initfs-hook.sh
2dde30d3f7450c9e0ce375580ed5ece68ced09cff81ef11c1700c6263db63d4bb1eeca6b2f01b226426525674384643a74c26bbfb6ad8e1b41a43d959b5d1817 logo.rle"

View file

@ -0,0 +1,32 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Sony Xperia L"
deviceinfo_manufacturer="Sony"
deviceinfo_date="2013"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armhf"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="854"
deviceinfo_screen_height="480"
deviceinfo_dev_touchscreen="/dev/input/event2"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x80200000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,7 @@
mode "480x854-0"
# D: 0.003 MHz, H: 0.004 kHz, V: 0.005 Hz
geometry 854 1708 854 1708 16
timings 400000000 50 50 9 9 20 4
accel false
rgba 8/24,8/16,8/8,8/0
endmode

View file

@ -0,0 +1,3 @@
#!/bin/sh
echo "Start the screen enlightener script"
/bin/sh /usr/sbin/sony-taoshan-screen-enlightener >/tmp/sony-taoshan-screen-enlightener.log 2>&1 </dev/null &

Binary file not shown.

View file

@ -0,0 +1,16 @@
#!/bin/sh
brightness_file="$(find /sys/devices/platform/msm_ssbi.0/ -name brightness | grep -v rgb | head -n1)"
test -z "$brightness_file" && {
echo "Can't find screen brightness file!"
exit 1
}
echo "Screen brightness : $brightness_file"
test -w "$brightness_file" || {
echo "Can't find write screen brightness file!"
exit 1
}
while true ; do
test "$(cat "$brightness_file")" -ne 255 && \
echo 255 > "$brightness_file"
sleep 1
done

View file

@ -0,0 +1,70 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/msm8960_defconfig
pkgname="linux-sony-taoshan"
pkgver=3.4.0
pkgrel=0
pkgdesc="Sony Xperia L kernel fork"
arch="armhf"
_carch="arm"
_flavor="sony-taoshan"
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"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_sony_msm8930"
_commit="df6292bc628cece5925d0f67fbc8c8a2cab2d524"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gpu-msm-fix-gcc5-compile.patch
mdss_fb_refresh_rate.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"
}
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="c81a890e9905547106a00ecb308d176d55a19f7d4ec0dcfde10c5d62647a917292c2098be2a657ff3cf6963f03ffaa019ddc1586ab378b9a39d10a850c806f53 linux-sony-taoshan-df6292bc628cece5925d0f67fbc8c8a2cab2d524.tar.gz
8236631fdd7ea8f382b1e5eb3eb53f44c11c488b2033615f57a298e66f4f0aec8c664fd3b01787c818c3f8806c254402dd9eebc3e2d0c0067231a68fd07e3408 config-sony-taoshan.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 gpu-msm-fix-gcc5-compile.patch
a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b0829375645107e4e6fbf241026b0cabe2b2ac895a47df83d2d8 mdss_fb_refresh_rate.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,90 @@
From a7bfe0a2832e66f3d732e4210b5d53c81cc7a85f Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu, 27 Sep 2018 19:16:56 -0400
Subject: [PATCH] give up on gcc ilog2() constant optimizations
commit 474c90156c8dcc2fa815e6716cc9394d7930cb9c upstream.
gcc-7 has an "optimization" pass that completely screws up, and
generates the code expansion for the (impossible) case of calling
ilog2() with a zero constant, even when the code gcc compiles does not
actually have a zero constant.
And we try to generate a compile-time error for anybody doing ilog2() on
a constant where that doesn't make sense (be it zero or negative). So
now gcc7 will fail the build due to our sanity checking, because it
created that constant-zero case that didn't actually exist in the source
code.
There's a whole long discussion on the kernel mailing about how to work
around this gcc bug. The gcc people themselevs have discussed their
"feature" in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
but it's all water under the bridge, because while it looked at one
point like it would be solved by the time gcc7 was released, that was
not to be.
So now we have to deal with this compiler braindamage.
And the only simple approach seems to be to just delete the code that
tries to warn about bad uses of ilog2().
So now "ilog2()" will just return 0 not just for the value 1, but for
any non-positive value too.
It's not like I can recall anybody having ever actually tried to use
this function on any invalid value, but maybe the sanity check just
meant that such code never made it out in public.
[js] no tools/include/linux/log2.h copy of that yet
Reported-by: Laura Abbott <labbott@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>,
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/log2.h | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/include/linux/log2.h b/include/linux/log2.h
index fd7ff3d91..f38fae23b 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -15,12 +15,6 @@
#include <linux/types.h>
#include <linux/bitops.h>
-/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
/*
* non-constant log of base 2 calculators
* - the arch may override these in asm/bitops.h if they can be implemented
@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
#define ilog2(n) \
( \
__builtin_constant_p(n) ? ( \
- (n) < 1 ? ____ilog2_NaN() : \
+ (n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
@@ -148,10 +142,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
(n) & (1ULL << 4) ? 4 : \
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
- (n) & (1ULL << 1) ? 1 : \
- (n) & (1ULL << 0) ? 0 : \
- ____ilog2_NaN() \
- ) : \
+ 1 ) : \
(sizeof(n) <= 4) ? \
__ilog2_u32(n) : \
__ilog2_u64(n) \

View file

@ -0,0 +1,45 @@
From 8c8187d41b99acd4f2078d0fff6807e0eeb47407 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 26 Jul 2018 10:13:23 +0200
Subject: [PATCH] ARM: fix put_user() for gcc-8
Building kernels before linux-4.7 with gcc-8 results in many build failures
when gcc triggers a check that was meant to catch broken compilers:
/tmp/ccCGMQmS.s:648: Error: .err encountered
According to the discussion in the gcc bugzilla, a local "register
asm()" variable is still supposed to be the correct way to force an
inline assembly to use a particular register, but marking it 'const'
lets the compiler do optimizations that break that, i.e the compiler is
free to treat the variable as either 'const' or 'register' in that case.
Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code
duplication") fixed this problem in linux-4.8 as part of a larger change,
but seems a little too big to be backported to 4.4.
Let's take the simplest fix and change only the one broken line in the
same way as newer kernels.
Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/include/asm/uaccess.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 292c3f88f..48decaa00 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -158,7 +158,7 @@ extern int __put_user_8(void *, unsigned long long);
#define put_user(x,p) \
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = (p);\
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \

View file

@ -0,0 +1,33 @@
source:
https://github.com/ShinySide/HispAsian_Lollipop_G6/commit/b7756b6fc4bb728722b14d2dfdbaf1dc843812e9
* These need to be static to avoid these errors:
drivers/built-in.o: In function `.LANCHOR1':
msm_iommu_sec.c:(.data+0x9298): undefined reference to `kgsl_iommu_sync_lock'
msm_iommu_sec.c:(.data+0x929c): undefined reference to `kgsl_iommu_sync_unlock'
Makefile:877: recipe for target '.tmp_vmlinux1' failed
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -1010,7 +1010,7 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
@@ -1080,7 +1080,7 @@ inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;

View file

@ -0,0 +1,13 @@
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index b37fd1e07ac1..1f091a261d22 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -2668,7 +2668,7 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
var->left_margin = panel_info->lcdc.h_back_porch;
var->right_margin = panel_info->lcdc.h_front_porch;
var->hsync_len = panel_info->lcdc.h_pulse_width;
- var->pixclock = panel_info->clk_rate / 1000;
+ var->pixclock = 1000000 / 60;
/*
* Store the cont splash state in the var reserved[3] field.