samsung-i927: new device (Samsung Captive Glide) (!195)

Runs an only slightly patched mainline kernel.

For now:
- flashing works (only SD card boot and kernel flashing tested)
- boots
- screen works
- keyboard works
- touch works
- accelerated Xorg works (OGL not tested, xf86-video-tegra works,
  but sometims X crashes with invalid instruction error - open top menus in
  Xfce file manager to reproduce)
- SD card works (troubles with GPIO insertion detection)
- USB should work, not tested
- WiFi should work, also not tested (a lot of warnings during boot)
- Sound needs configuration
- battery needs kernel driver (max8922/max8907c)
- touchkey doesn't work - very strange hardware here...
- cameras don't work - no DT bindings, but all drivers there

Other functionality is broken/not tested.

[skip ci]: already built successfully in CI
This commit is contained in:
Sergey Larin 2019-02-04 20:25:21 +03:00 committed by Oliver Smith
parent a72cf419ad
commit e007f80165
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
7 changed files with 7527 additions and 0 deletions

View File

@ -0,0 +1,45 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-samsung-i927"
pkgdesc="Samsung Captivate Glide"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armhf"
options="!check !archcheck"
depends="postmarketos-base
linux-samsung-i927
mkbootimg
alsa-utils
libdrm-grate
mesa-grate
mesa-grate-gl
mesa-grate-egl
mesa-grate-dri-swrast
mesa-grate-dri-tegra
xf86-video-opentegra
libvdpau-tegra"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo
modules-load.conf"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -D -m644 "$srcdir"/modules-load.conf \
"$pkgdir"/etc/modules-load.d/00-${pkgname}.conf
}
nonfree_firmware() {
pkgdesc="bcm4330 wifi firmware"
depends="firmware-samsung-i927"
mkdir "$subpkgdir"
}
sha512sums="7edacfb24ec729bcf354ad3516aca0b17bceadef4090d848d30fb2fa77494a50d4e5901033222094c758a8b81d97710df1d460fd613541da11f566110ea4b9b0 deviceinfo
d8ce60ea7acaabf627ddca2f0887a4cda46f313b7aaf7934bef2fef8a6e0798ccefab849e4571e4e3fcd06ae34c1a6efe3b58b401e2e443416f6200e6d4ea769 modules-load.conf"

View File

@ -0,0 +1,35 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Samsung Captivate Glide"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-i927"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armhf"
# Device related
deviceinfo_keyboard="true"
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="heimdall-bootimg"
deviceinfo_kernel_cmdline="console=pstore console=tty0 fbcon=rotate:1 brcmfmac.alternative_fw_path=postmarketos gpt ramoops.mem_address=0x25000000 ramoops.mem_size=0x100000 ramoops.mem_type=1 ramoops.dump_oops=1 ramoops.ftrace_size=0 ramoops.pmsg_size=0 ramoops.console_size=0x10000 ramoops.record_size=0x80000 PMOS_NO_OUTPUT_REDIRECT"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_heimdall_partition_kernel="LNX"
deviceinfo_flash_heimdall_partition_system="APP"

View File

@ -0,0 +1,5 @@
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# wifi module
brcmfmac

View File

@ -0,0 +1,75 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/tegra_defconfig
pkgname="linux-samsung-i927"
pkgver=4.20.4
pkgrel=0
pkgdesc="Samsung Captivate Glide kernel fork"
arch="armhf"
_carch="arm"
_flavor="samsung-i927"
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 flex bison openssl-dev"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="linux"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$pkgver.tar.gz::https://kernel.org/pub/linux/kernel/v4.x/linux-$pkgver.tar.gz
$_config
kernel.patch
"
builddir="$srcdir/${_repository}-${pkgver}"
prepare() {
default_prepare
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
cp "$srcdir/$_config" "$builddir"/.config
yes "" | make -C "$builddir" ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
cat "$builddir/arch/arm/boot/zImage" \
"$builddir/arch/arm/boot/dts/tegra20-glide.dtb" \
> "$builddir/arch/arm/boot/zImage-dtb"
# 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
cd "$builddir"
make modules_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir"
}
sha512sums="5f9eb065932e404091dd9e4afd5a92b6382ddbc81488684c42981cdfe227da9a423356c19ec236ca1a9a7f4bf042cf351aa8b3cd4f7488b0d8b1245d69221a5c linux-samsung-i927-4.20.4.tar.gz
fb556670c376c85f6c0ad0105179298e8d7b1564e32c7a50152924112407dcc294b5e322eb207e801f61e81f9511e28c52dcd663152c2e5a1ea1a9e0100d09ba config-samsung-i927.armhf
c65a89a07b20b3720d6187c6049f215823b07fd4ba647984691bf37d2488a71f4e00ce8bc9521c499b7e15f13fb1473289a8eeea42899d5a6c0c3247b0a94549 kernel.patch"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
pkgname=firmware-samsung-i927
pkgver=1
pkgrel=1
pkgdesc="Samsung SGH-i927 Firmware"
url="https://github.com/The-Covenant"
arch="armhf"
license="proprietary"
options="!check"
# Source
_fw_file="bcm4330_sta.bin"
_nvram_file="nvram_net.txt"
_commit="73d33be8ff2323eb51aa7f8c4916e946850e8bfe"
_url_fw="https://github.com/The-Covenant/proprietary_vendor_samsung/raw/$_commit/i927/proprietary/$_fw_file"
_url_nvram="https://github.com/The-Covenant/proprietary_vendor_samsung/raw/$_commit/i927/proprietary/$_nvram_file"
source=""
source="$source $pkgname-$_commit-$_fw_file::$_url_fw";
source="$source $pkgname-$_commit-$_nvram_file::$_url_nvram";
package() {
install -Dm644 "$srcdir/$pkgname-$_commit-$_fw_file" \
"$pkgdir/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.bin"
install -Dm644 "$srcdir/$pkgname-$_commit-$_nvram_file" \
"$pkgdir/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.txt"
}
sha512sums="3ae32e0c27a9143fa07e823c414639387aced9bdc149762806059b9dd3ebd3358675657a3cae25572db4e40e4f682d446aadd87c7d459269fc7d2ccf99a2c449 firmware-samsung-i927-73d33be8ff2323eb51aa7f8c4916e946850e8bfe-bcm4330_sta.bin
1fac44f6c1d312cefc5c5bc2b66be41c877a0be6448359b95e7a966553acbf249b193a531a1d4dbdb1d8ec58dd43215d9f3d6c869374612593eb88a70d1a6d93 firmware-samsung-i927-73d33be8ff2323eb51aa7f8c4916e946850e8bfe-nvram_net.txt"