Skip to content
Snippets Groups Projects
Commit 436dc046 authored by Dzmitry Sankouski's avatar Dzmitry Sankouski Committed by Dzmitry
Browse files

samsung-starqltechn: add device SM-G9600

Device uses mainline kernel. What works:
- boots
- pstore log
- simple framebuffer
- storage including sdcard

* payload mock device tree:

Payload mock device tree is needed to mock device tree,
when we're overriding linux with u-boot in android boot image.
Stock bootloader needs this dtb appended to gzipped u-boot.

Bootscript is a simple hush shell script, dedicated to boot OS.
It may be customized to implement dual boot or to change kernel
command line.
parent 96c6504c
No related branches found
No related tags found
No related merge requests found
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-samsung-starqltechn"
pkgdesc="Samsung Galaxy S9"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-postmarketos-qcom-sdm845-starqltechn mesa-dri-swrast mkbootimg u-boot-starqltechn u-boot-tools dtc"
makedepends="devicepkg-dev linux-postmarketos-qcom-sdm845-starqltechn postmarketos-mkinitfs dtc"
source="deviceinfo *.its payload_mock.dts bootscript.sh"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
mkdir -p "$pkgdir"/usr/share/u-boot/starqltechn/
mkdir "$builddir"
payload_mock_dtb="$builddir/payload_mock.dtb"
dtc -I dts -O dtb -o "$payload_mock_dtb" "$srcdir/payload_mock.dts"
install -D -m644 "$payload_mock_dtb" \
"$pkgdir"/usr/share/u-boot/starqltechn/payload_mock.dtb
install -D -m644 "$srcdir/"*.its \
"$pkgdir"/usr/share/u-boot/starqltechn/
install -D -m644 "$srcdir/"bootscript.sh \
"$pkgdir"/usr/share/u-boot/starqltechn/
}
sha512sums="
1a51b1a75a7ab23b0011d2952e716b6d98a3a395578a99e278d8eda4c921ce015ce1f0e386a88b89e9f657edc867f00fffd11e550a91ec9ede2769d8cbfd1718 deviceinfo
8e33da25b994a6258e0c1769182d873428c311158f420c28d91566b7d1eb9809b0076a5a2b41726ff5039859dd7c2e1c13efd608dc707fc3b6bc9d93ef147cde boot_image.its
ba782c324c14cf0947c752b51a607ae1b08def885b0cf0afe89d1fcade3491ab2f547551eb08bd8074f608dac46bdcdf75c5c633bd7a15e6eb63a10f30994c82 payload_mock.dts
d7c5c52cb3b747d814680411cc2381e6158714f89aa7ffbeb639193cb10346f6f5b4b8897d2e1c0ce3889178e845599686e8e525a369be35503c2018f152fdb1 bootscript.sh
"
/dts-v1/;
/ {
description = "Samsung S9 SM-G9600 starqltechn FIT Image";
#address-cells = <1>;
images {
bootscript {
description = "Boot script";
data = /incbin/("bootscript.sh");
type = "script";
compression = "none";
load = <0x90000000>;
entry = <0x90000000>;
hash {
algo = "sha1";
};
};
kernel {
description = "Kernel";
data = /incbin/("vmlinuz");
type = "kernel";
arch = "arm64";
os = "linux";
compression = "gzip";
load = <0x80000000>;
entry = <0x80000000>;
hash {
algo = "sha1";
};
};
fdt {
description = "DTB";
data = /incbin/("/usr/share/dtb/qcom/sdm845-samsung-starqltechn.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
load = <0x81a80000>;
entry = <0x81a80000>;
hash {
algo = "sha1";
};
};
initrd {
description = "Initrd";
compression = "none";
data = /incbin/("initramfs");
type = "ramdisk";
arch = "arm64";
load = <0x81000000>;
os = "linux";
hash {
algo = "sha1";
};
};
};
configurations {
default = "standard";
standard {
description = "Standard Boot";
kernel = "kernel";
fdt = "fdt";
ramdisk = "initrd";
hash {
algo = "sha1";
};
};
};
};
setenv bootargs 'console=tty1 loglevel=15 clk_ignore_unused'
bootm $prevbl_initrd_start_addr
\ No newline at end of file
# 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 Galaxy S9"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-starqltechn"
deviceinfo_uboot_boardname="starqltechn"
deviceinfo_year="2018"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="2960"
deviceinfo_screen_height="1440"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_kernel_cmdline="console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048"
deviceinfo_generate_bootimg="true"
deviceinfo_generate_uboot_fit_images="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_bootimg_override_payload="u-boot.bin"
deviceinfo_bootimg_override_payload_compression="gzip"
deviceinfo_bootimg_override_payload_append_dtb="payload_mock.dtb"
deviceinfo_bootimg_override_initramfs="boot_image.itb"
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_heimdall_partition_kernel="BOOT"
deviceinfo_flash_heimdall_partition_initfs="BOOT"
deviceinfo_flash_heimdall_partition_system="SYSTEM"
/dts-v1/;
/ {
memory {
/* We expect the bootloader to fill in the size */
reg = <0 0 0 0>;
};
chosen { };
};
\ No newline at end of file
# Temprorary package, based on linux-postmarketos-qcom-sdm845
_flavor="postmarketos-qcom-sdm845-starqltechn"
pkgname=linux-$_flavor
pkgver=5.10.12
pkgrel=1
pkgdesc="Mainline Kernel fork for starqltechn"
arch="aarch64"
_carch="arm64"
url="https://gitlab.com/dsankouski"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-nftables
pmb:kconfigcheck-containers
pmb:kconfigcheck-zram
pmb:kconfigcheck-anbox"
makedepends="bison findutils flex installkernel openssl-dev perl"
_repo="sdm845-linux-next"
_config="config-$_flavor.$arch"
_commit="992abc9af973142c8950b5d611f140c8eccb9385"
# Source
source="
$_repo-$_commit.tar.gz::$url/$_repo/-/archive/$_commit/$_repo-$_commit.tar.gz
$_config
"
builddir="$srcdir/$_repo-$_commit"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
}
package() {
mkdir -p "$pkgdir"/boot
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz"
make modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot/ \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
30361b67312cb4fd8b3e794dce8139e60abdd8bb1e8a44ee644871ad57251865d2b63825049acbf750c485836e3249b9df4025c24a3495c8a4ca5d3fb7bebe9e sdm845-linux-next-992abc9af973142c8950b5d611f140c8eccb9385.tar.gz
0724de72c425da9ac29c9dc0f0146e890bafac4206d71d57eaf5c0c3e1b65cd4b896d71ccca8df17d76c46e761a9c243dc408a9df68af4c2ecb4c11d6719f59e config-postmarketos-qcom-sdm845-starqltechn.aarch64
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment