New device: samsung-i9003 (#729)
This commit is contained in:
parent
50d682901e
commit
7840c9e342
11 changed files with 3022 additions and 0 deletions
8
device/device-samsung-i9003/90-android-touch-dev.rules
Normal file
8
device/device-samsung-i9003/90-android-touch-dev.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}=="sec_touchscreen", \
|
||||
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \
|
||||
#ENV{WL_CALIBRATION}="0.954174 0.016888 -2.626083 -0.006031 1.011271 14.175903"
|
||||
|
28
device/device-samsung-i9003/APKBUILD
Normal file
28
device/device-samsung-i9003/APKBUILD
Normal file
|
@ -0,0 +1,28 @@
|
|||
pkgname=device-samsung-i9003
|
||||
pkgver=1
|
||||
pkgrel=13
|
||||
pkgdesc="Samsung Galaxy SI SLC"
|
||||
url="https://github.com/postmarketOS"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="linux-samsung-i9003 libsamsung-ipc mkbootimg"
|
||||
makedepends=""
|
||||
install="$pkgname.post-install"
|
||||
subpackages=""
|
||||
source="
|
||||
deviceinfo
|
||||
90-android-touch-dev.rules
|
||||
$install
|
||||
"
|
||||
options="!check"
|
||||
|
||||
package() {
|
||||
install -D -m644 "$srcdir/deviceinfo" \
|
||||
"$pkgdir/etc/deviceinfo"
|
||||
install -D -m644 "$srcdir"/90-android-touch-dev.rules \
|
||||
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
|
||||
}
|
||||
|
||||
sha512sums="95ab784d79cf31324b50d83c5b41feadd89c7315b237f18194da1e40af55683340237fa286a5edb30c8855e2f6f5e04fca93782ccdec3c056a56acfc61396453 deviceinfo
|
||||
079336f0a62fe45e839dcaa56479736fb67125ef5adf9bf73fc513c696d5a9fe14cfc9912f4aeb989476aa23bcd1befca25f0163c827691eea7eec1c7b97f303 90-android-touch-dev.rules
|
||||
543f39af1ae7a2382ed869cbd1ee1ac598a88eb4e213cd64487c54b5c37722c6207ee6db4fa7e2ed53064259a44115c6da7bbc8c068378bb52a25e7088eeebd6 device-samsung-i9003.post-install"
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
37
device/device-samsung-i9003/deviceinfo
Normal file
37
device/device-samsung-i9003/deviceinfo
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Galaxy SI SLC"
|
||||
deviceinfo_manufacturer="Samsung"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_nonfree="????"
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_external_disk="true"
|
||||
deviceinfo_external_disk_install="true"
|
||||
deviceinfo_flash_methods="heimdall-bootimg"
|
||||
deviceinfo_arch="armhf"
|
||||
|
||||
# Device related
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_screen_width="480"
|
||||
deviceinfo_screen_height="800"
|
||||
deviceinfo_dev_touchscreen="/dev/input/event2"
|
||||
|
||||
# Offsets for the boot.img
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_kernel_cmdline="console=ttySAC2,115200 buildvariant=userdebug"
|
||||
deviceinfo_flash_offset_kernel=0x00008000
|
||||
deviceinfo_flash_offset_ramdisk=0x1000000
|
||||
deviceinfo_flash_offset_second=0x00f00000
|
||||
deviceinfo_flash_offset_tags=0x00000100
|
||||
deviceinfo_flash_pagesize=4096
|
||||
|
||||
# Heimdall related
|
||||
deviceinfo_flash_heimdall_partition_kernel="NORMALBOOT"
|
||||
deviceinfo_flash_heimdall_partition_initfs="RECOVERY"
|
||||
deviceinfo_flash_heimdall_partition_system="SYSTEM"
|
||||
|
||||
deviceinfo_weston_core_modules="xwayland.so"
|
||||
|
29
device/linux-samsung-i9003/00_return_address.patch
Normal file
29
device/linux-samsung-i9003/00_return_address.patch
Normal 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);
|
12
device/linux-samsung-i9003/01_twl_power_init.patch
Normal file
12
device/linux-samsung-i9003/01_twl_power_init.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
|
||||
index d56945e..53033bd 100644
|
||||
--- a/include/linux/i2c/twl.h
|
||||
+++ b/include/linux/i2c/twl.h
|
||||
@@ -743,7 +743,6 @@ static inline int twl4030_remove_script(u8 flags) { return -EINVAL; }
|
||||
#ifdef CONFIG_TWL6030_POWER
|
||||
extern void twl6030_power_init(struct twl4030_power_data *power_data);
|
||||
#else
|
||||
-extern inline void twl6030_power_init(struct twl4030_power_data *power_data) { }
|
||||
#endif
|
||||
|
||||
struct twl4030_codec_audio_data {
|
13
device/linux-samsung-i9003/02_mfd_driver_fix.patch
Normal file
13
device/linux-samsung-i9003/02_mfd_driver_fix.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
|
||||
index 7df976d..1937e6c 100644
|
||||
--- a/drivers/mfd/twl-core.c
|
||||
+++ b/drivers/mfd/twl-core.c
|
||||
@@ -1352,8 +1352,6 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
twl4030_power_sr_init();
|
||||
twl4030_power_init(pdata->power);
|
||||
}
|
||||
- if (twl_class_is_6030())
|
||||
- twl6030_power_init(pdata->power);
|
||||
}
|
||||
|
||||
/* Maybe init the T2 Interrupt subsystem */
|
136
device/linux-samsung-i9003/APKBUILD
Normal file
136
device/linux-samsung-i9003/APKBUILD
Normal file
|
@ -0,0 +1,136 @@
|
|||
# Based on linux-lg-mako. Changes:
|
||||
# - add findutils makedepend (necessary for the initramfs)
|
||||
# - it builds an initramfs - do not use ramdisk.cpio and
|
||||
# ramdisk-recovery-device.cpio, in there, always use the
|
||||
# initramfs from the recovery partition ("isorec")
|
||||
# - directly boot to that initramfs, not only when the recovery
|
||||
# key combination was pressed.
|
||||
# - use Alpine's busybox-static instead of the pre-compiled
|
||||
# binary, that comes with the source
|
||||
#
|
||||
# Kernel config changes, based on: arch/arm/configs/latona_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)
|
||||
|
||||
_vendor=samsung
|
||||
_flavor=samsung-i9003
|
||||
_hash="7b8d73dd32e6cd21107f9a963a32a5ed237a6e78"
|
||||
_config="config-${_flavor}.armhf"
|
||||
|
||||
pkgname=linux-${_flavor}
|
||||
pkgver=3.0.101
|
||||
case $pkgver in
|
||||
*.*.*) _kernver=${pkgver%.*};;
|
||||
*.*) _kernver=$pkgver;;
|
||||
esac
|
||||
pkgrel=9
|
||||
arch="armhf"
|
||||
pkgdesc="Samsung Galaxy SI SLC kernel"
|
||||
url="https://github.com/dhiru1602/android_kernel_samsung_latona"
|
||||
depends="postmarketos-mkinitfs"
|
||||
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
|
||||
findutils busybox-static-armhf"
|
||||
options="!strip !check !tracedeps"
|
||||
install=
|
||||
source="
|
||||
$pkgname-$_hash.tar.gz::https://github.com/dhiru1602/android_kernel_samsung_latona/archive/${_hash}.tar.gz
|
||||
$_config
|
||||
compiler-gcc6.h
|
||||
00_return_address.patch
|
||||
01_twl_power_init.patch
|
||||
02_mfd_driver_fix.patch
|
||||
init
|
||||
"
|
||||
subpackages=""
|
||||
license="GPL2"
|
||||
|
||||
_abi_release=${pkgver}
|
||||
_carch="arm"
|
||||
HOSTCC="${CC:-gcc}"
|
||||
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
||||
|
||||
ksrcdir="$srcdir/android_kernel_samsung_latona-${_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/"
|
||||
|
||||
mkdir -p "$srcdir"/build
|
||||
cp "$srcdir"/$_config "$srcdir"/build/.config
|
||||
make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
|
||||
silentoldconfig
|
||||
|
||||
|
||||
mkdir "$ksrcdir"/usr/latona_initramfs_files/
|
||||
|
||||
# Use Alpine's busybox.static instead of the pre-compiled busybox shipped
|
||||
# with the source
|
||||
cp -v /usr/$(arch_to_hostspec $arch)/bin/busybox.static \
|
||||
"$ksrcdir"/usr/latona_initramfs_files/busybox
|
||||
|
||||
# use custom init script in the initramfs which loads the initramfs from
|
||||
# the kernel2 partition ("isorec")
|
||||
cp -v "$srcdir"/init "$ksrcdir"/usr/latona_initramfs_files/init
|
||||
|
||||
mkdir -p "$srcdir"/build
|
||||
cp "$srcdir"/$_config "$srcdir"/build/.config
|
||||
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
|
||||
make ARCH="$_carch" menuconfig
|
||||
#ARCH="$_carch" "$ksrcdir"/scripts/kconfig/merge_config.sh "$ksrcdir"/arch/arm/config/latona_defconfig "$ksrcdir"/android/configs/android-base.cfg "$ksrcdir"/android/configs/android-recommended.cfg
|
||||
cp .config "$startdir"/$_config
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir"/build
|
||||
unset LDFLAGS
|
||||
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine"
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
|
||||
"$pkgdir/boot/vmlinuz-$_flavor"
|
||||
|
||||
install -D "$srcdir/build/include/config/kernel.release" \
|
||||
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
||||
}
|
||||
|
||||
sha512sums="b7ca46b856a0c160ae36a98da39147deb85c054e902447ab68bcd4a011986eee486fb681d0bb832b9b57797aca35332483e99379b792bd467b1f030328bd83c7 linux-samsung-i9003-7b8d73dd32e6cd21107f9a963a32a5ed237a6e78.tar.gz
|
||||
ac6d9fd10aca7a9460d26bd78d70a6aacfdc9ca28ec10a04210211f748724dbb0018c6388d407327c8736f896c956b0d8ba4b3c72f05e65cd664a8261381a9a9 config-samsung-i9003.armhf
|
||||
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
|
||||
c40eaa11547f5bc2b1ff965506bdfe3015ff16e4b5ad9ccb3b8134ceafd1d32407c4ef2b213e02e036ce1e9bdcbfe768dff7d4b054bec77705a176c1f783b6f5 00_return_address.patch
|
||||
1972a2b5c429d6bf5fa1423e8805bb89bbd80c4efe6d235cb2037de6ba4d15c01e90239392161d6e5a0802eafaab6e8b468a49a12dc5b66469a111262cde2047 01_twl_power_init.patch
|
||||
5b951a2ab60a89fbc3ca209960987035001a6f9147f8ab5c05a6b49ec6dee75d0b6d053bef28df37e583bfc903599beed16692e25ee363e6200e14839d0dda65 02_mfd_driver_fix.patch
|
||||
dd4094d5f4ec281d32f12af88cb22a782e497c8e52f69cf60b73ac7d6171fc95f1f8040b3d0ad2ff3f016d22ac1d91c5b522e5d03203534a76742bc55a082af5 init"
|
69
device/linux-samsung-i9003/compiler-gcc6.h
Normal file
69
device/linux-samsung-i9003/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 */
|
||||
|
2660
device/linux-samsung-i9003/config-samsung-i9003.armhf
Normal file
2660
device/linux-samsung-i9003/config-samsung-i9003.armhf
Normal file
File diff suppressed because it is too large
Load diff
29
device/linux-samsung-i9003/init
Normal file
29
device/linux-samsung-i9003/init
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/stage1/busybox sh
|
||||
|
||||
# Samsung kernels come with their own initramfs, which extract and load another
|
||||
# initramfs. Usually that depends on the recovery key combination being pressed
|
||||
# or not. For simplicity, we always boot the recovery image (from the recovery
|
||||
# partition) here.
|
||||
|
||||
_PATH="$PATH"
|
||||
export PATH=/stage1
|
||||
|
||||
busybox cd /
|
||||
busybox date >>boot.txt
|
||||
exec >>boot.txt 2>&1
|
||||
busybox rm init
|
||||
busybox mount -t proc proc /proc
|
||||
busybox mount -t sysfs sysfs /sys
|
||||
|
||||
# always use the "isorec"-style lzop compressed initramfs
|
||||
# from the recovery partition
|
||||
load_image=/stage1/isorec.cpio
|
||||
busybox lzop -dc /dev/block/mmcblk0p6 > ${load_image}
|
||||
busybox cpio -i < ${load_image}
|
||||
|
||||
busybox umount /sys
|
||||
busybox umount /proc
|
||||
busybox date >>boot.txt
|
||||
busybox rm -fr /stage1 /dev/*
|
||||
export PATH="${_PATH}"
|
||||
exec /init
|
Loading…
Reference in a new issue