samsung-starqltechn: new device (MR 2835)

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.
This commit is contained in:
Dzmitry Sankouski 2019-09-12 18:43:00 +03:00 committed by Newbyte
parent 9476f65b87
commit 310b01ef45
No known key found for this signature in database
GPG key ID: 5873C171C9429CFA
5 changed files with 158 additions and 0 deletions

View file

@ -0,0 +1,38 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-starqltechn
pkgdesc="Samsung Galaxy S9 SM-G9600"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-postmarketos-qcom-sdm845 mesa-dri-gallium mkbootimg u-boot-starqltechn u-boot-tools dtc"
makedepends="devicepkg-dev dtc"
source="deviceinfo boot_image.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
"

View file

@ -0,0 +1,70 @@
/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";
};
};
};
};

View file

@ -0,0 +1,3 @@
setenv bootargs 'console=tty1 loglevel=15 clk_ignore_unused'
bootm $prevbl_initrd_start_addr

View file

@ -0,0 +1,38 @@
# 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"

View file

@ -0,0 +1,9 @@
/dts-v1/;
/ {
memory {
/* We expect the bootloader to fill in the size */
reg = <0 0 0 0>;
};
chosen { };
};