Add Xperia Z3C port (#448)
Booting works, SSH does not work yet (missing UDEVTMPFS?), screen does not work yet.
This commit is contained in:
parent
8b420832df
commit
ed76dd9110
9 changed files with 4156 additions and 0 deletions
8
device/device-sony-aries/90-android.rules
Normal file
8
device/device-sony-aries/90-android.rules
Normal file
|
@ -0,0 +1,8 @@
|
|||
# udev rules file
|
||||
# All device names can be read from weston's logfile (/tmp/weston.log in postmarketOS)
|
||||
|
||||
# Touchscreen (use 'weston-calibrator' to calibrate)
|
||||
SUBSYSTEM=="input", ATTRS{name}=="clearpad", \
|
||||
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \
|
||||
ENV{WL_CALIBRATION}="1.013786 0.035310 -24.920929 -0.008370 0.990421 12.094299"
|
||||
|
30
device/device-sony-aries/APKBUILD
Normal file
30
device/device-sony-aries/APKBUILD
Normal file
|
@ -0,0 +1,30 @@
|
|||
pkgname=device-sony-aries
|
||||
pkgver=1
|
||||
pkgrel=8
|
||||
pkgdesc="Sony Xperia Z3 Compact"
|
||||
url="https://github.com/postmarketOS"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="linux-sony-aries mkbootimg"
|
||||
makedepends=""
|
||||
install=""
|
||||
subpackages=""
|
||||
source="deviceinfo 90-android.rules fb-workaround.sh"
|
||||
options="!check"
|
||||
|
||||
build() {
|
||||
return 0
|
||||
}
|
||||
|
||||
package() {
|
||||
install -D -m644 "$srcdir/deviceinfo" \
|
||||
"$pkgdir/etc/deviceinfo"
|
||||
install -D -m644 "$srcdir"/90-android.rules \
|
||||
"$pkgdir"/etc/udev/rules.d/90-android.rules
|
||||
install -D -m644 "$srcdir"/fb-workaround.sh \
|
||||
"$pkgdir"/etc/profile.d/fb-workaround.sh
|
||||
}
|
||||
|
||||
sha512sums="f8d6a912d39b5d30c0364b6bceb39c079e6438352c91ed5acfe3c7835115d83954633659b0264ae9752b930ddcb09b2297634448dfdd488008b85309b0ad1c50 deviceinfo
|
||||
1dd1196aa9abe0308a0841147e7e5c6eb50da742cfc3194b90ef22a62d034b43ddade70384b78ab38fa0177da5a822f2a40f1386f4ecd591e2ecc80cb679133a 90-android.rules
|
||||
13f36f33cfae5e759b3889bc4e308324fd9bcf1cc7b097bbbe3646f1243b3bc06e1b1594cc8578c52c304a2b5006babd978c5b3f258769892e80552457889f99 fb-workaround.sh"
|
29
device/device-sony-aries/deviceinfo
Normal file
29
device/device-sony-aries/deviceinfo
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Xperia Z3 Compact"
|
||||
deviceinfo_manufacturer="Sony"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_nonfree="????"
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_external_disk="true"
|
||||
deviceinfo_external_disk_install="true"
|
||||
deviceinfo_flash_methods="fastboot"
|
||||
deviceinfo_arch="armhf"
|
||||
deviceinfo_generate_bootimg="true"
|
||||
|
||||
# Splash screen
|
||||
deviceinfo_screen_width="720"
|
||||
deviceinfo_screen_height="1280"
|
||||
|
||||
# Fastboot related
|
||||
deviceinfo_flash_offset_kernel="0x00008000"
|
||||
deviceinfo_flash_offset_ramdisk="0x02000000"
|
||||
deviceinfo_flash_offset_second="0x00f00000"
|
||||
deviceinfo_flash_offset_tags="0x01e00000"
|
||||
deviceinfo_flash_pagesize="2048"
|
||||
|
||||
deviceinfo_weston_core_modules="xwayland.so"
|
15
device/device-sony-aries/fb-workaround.sh
Normal file
15
device/device-sony-aries/fb-workaround.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
main() {
|
||||
# Wait untill graphical enviroment is running
|
||||
sleep 135
|
||||
# Workaround for buggy graphics driver
|
||||
for i in 1 2
|
||||
do
|
||||
echo "0,0" > /sys/class/graphics/fb0/pan
|
||||
done
|
||||
}
|
||||
|
||||
# tty1 autologin
|
||||
if [ $(tty) = "/dev/tty1" ]; then
|
||||
# Run in background, to make /etc/profile not wait for it to finish
|
||||
main &
|
||||
fi
|
4
device/device-sony-aries/initfs-hook.sh
Normal file
4
device/device-sony-aries/initfs-hook.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# set framebuffer resolution
|
||||
cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode
|
110
device/linux-sony-aries/APKBUILD
Normal file
110
device/linux-sony-aries/APKBUILD
Normal file
|
@ -0,0 +1,110 @@
|
|||
# APKBUILD based on linux-vanilla aport. Changes:
|
||||
# - disabled module installation
|
||||
# - add !check !tracedeps
|
||||
# - package: just install zImage-dtb and kernel.release, because the kernel config
|
||||
# does not generate modules or dtb files
|
||||
# - do not create -dev subpackage (makes no sense without module support)
|
||||
#
|
||||
# Kernel config changes, based on: arch/arm/configs/aosp_shinano_aries_defconfig
|
||||
# - enable devtmpfs (needed for udev -> touch support in weston)
|
||||
# - change compression from CONFIG_KERNEL_LZMA=y to
|
||||
# CONFIG_KERNEL_GZIP=y (so it works with busybox)
|
||||
# - disable proprietary graphics driver
|
||||
|
||||
_vendor=sony
|
||||
_flavor=sony-aries
|
||||
_hash="b1ceda7b02ea29c526d329884db1e9f2694ab394"
|
||||
_config="config-${_flavor}.armhf"
|
||||
|
||||
pkgname=linux-${_flavor}
|
||||
pkgver=3.10.84
|
||||
case $pkgver in
|
||||
*.*.*) _kernver=${pkgver%.*};;
|
||||
*.*) _kernver=$pkgver;;
|
||||
esac
|
||||
pkgrel=1
|
||||
arch="armhf"
|
||||
pkgdesc="Sony Xperia Z3 Compact kernel"
|
||||
url="https://github.com/sonyxperiadev/kernel"
|
||||
depends="postmarketos-mkinitfs"
|
||||
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev"
|
||||
options="!strip !check !tracedeps"
|
||||
install=
|
||||
source="
|
||||
$pkgname-$_hash.tar.gz::https://github.com/sonyxperiadev/kernel/archive/${_hash}.tar.gz
|
||||
$_config
|
||||
compiler-gcc6.h
|
||||
mdss_fb_refresh_rate.patch
|
||||
"
|
||||
subpackages=""
|
||||
license="GPL2"
|
||||
|
||||
_abi_release=${pkgver}
|
||||
_carch="arm"
|
||||
HOSTCC="${CC:-gcc}"
|
||||
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
||||
|
||||
ksrcdir="$srcdir/kernel-${_hash}"
|
||||
|
||||
prepare() {
|
||||
local _patch_failed=
|
||||
cd "$ksrcdir"
|
||||
|
||||
# first apply patches in specified order
|
||||
for i in $source; do
|
||||
case $i in
|
||||
*.patch)
|
||||
msg "Applying $i..."
|
||||
if ! patch -s -p1 -N -i "$srcdir"/$i; then
|
||||
echo $i >>failed
|
||||
_patch_failed=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if ! [ -z "$_patch_failed" ]; then
|
||||
error "The following patches failed:"
|
||||
cat failed
|
||||
return 1
|
||||
fi
|
||||
|
||||
# gcc6 support
|
||||
cp -v "$srcdir/compiler-gcc6.h" "$ksrcdir/include/linux/" || return 1
|
||||
|
||||
mkdir -p "$srcdir"/build
|
||||
cp "$srcdir"/$_config "$srcdir"/build/.config || return 1
|
||||
make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
|
||||
silentoldconfig
|
||||
}
|
||||
|
||||
|
||||
|
||||
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
|
||||
menuconfig() {
|
||||
cd "$srcdir"/build || return 1
|
||||
make ARCH="$_carch" menuconfig
|
||||
cp .config "$startdir"/$_config
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir"/build
|
||||
unset LDFLAGS
|
||||
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \
|
||||
|| return 1
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm644 "$srcdir/build/arch/arm/boot/zImage-dtb" \
|
||||
"$pkgdir/boot/vmlinuz-$_flavor"
|
||||
|
||||
install -D "$srcdir/build/include/config/kernel.release" \
|
||||
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
||||
}
|
||||
|
||||
sha512sums="e6b36c25be89d17b43d24cde6ab199012113ffa3fac438780cc9b05f83f13e84b1977cb078069d19dba1a78005cd7c8534d8fd0660c134ae388ea7f0d32c41b1 linux-sony-aries-b1ceda7b02ea29c526d329884db1e9f2694ab394.tar.gz
|
||||
65607609ac5b03d33857dd5a12bf8a6fe2054e8f47e288f4f8c39dd881f052c0cef47e14dfc0e160d01ca37a326f6696200f5e4883ef57c895bef7d3dd39c229 config-sony-aries.armhf
|
||||
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
|
||||
a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b0829375645107e4e6fbf241026b0cabe2b2ac895a47df83d2d8 mdss_fb_refresh_rate.patch"
|
69
device/linux-sony-aries/compiler-gcc6.h
Normal file
69
device/linux-sony-aries/compiler-gcc6.h
Normal 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 */
|
||||
|
3878
device/linux-sony-aries/config-sony-aries.armhf
Normal file
3878
device/linux-sony-aries/config-sony-aries.armhf
Normal file
File diff suppressed because it is too large
Load diff
13
device/linux-sony-aries/mdss_fb_refresh_rate.patch
Normal file
13
device/linux-sony-aries/mdss_fb_refresh_rate.patch
Normal 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.
|
Loading…
Reference in a new issue