diff --git a/device/testing/device-samsung-starqltechn/APKBUILD b/device/testing/device-samsung-starqltechn/APKBUILD new file mode 100644 index 000000000..6f8552d88 --- /dev/null +++ b/device/testing/device-samsung-starqltechn/APKBUILD @@ -0,0 +1,38 @@ +# Reference: +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 +" diff --git a/device/testing/device-samsung-starqltechn/boot_image.its b/device/testing/device-samsung-starqltechn/boot_image.its new file mode 100644 index 000000000..ae9cff620 --- /dev/null +++ b/device/testing/device-samsung-starqltechn/boot_image.its @@ -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"; + }; + }; + }; +}; diff --git a/device/testing/device-samsung-starqltechn/bootscript.sh b/device/testing/device-samsung-starqltechn/bootscript.sh new file mode 100644 index 000000000..5177c5daa --- /dev/null +++ b/device/testing/device-samsung-starqltechn/bootscript.sh @@ -0,0 +1,3 @@ +setenv bootargs 'console=tty1 loglevel=15 clk_ignore_unused' + +bootm $prevbl_initrd_start_addr \ No newline at end of file diff --git a/device/testing/device-samsung-starqltechn/deviceinfo b/device/testing/device-samsung-starqltechn/deviceinfo new file mode 100644 index 000000000..63ea8a315 --- /dev/null +++ b/device/testing/device-samsung-starqltechn/deviceinfo @@ -0,0 +1,38 @@ +# Reference: +# 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" diff --git a/device/testing/device-samsung-starqltechn/payload_mock.dts b/device/testing/device-samsung-starqltechn/payload_mock.dts new file mode 100644 index 000000000..7f56b6684 --- /dev/null +++ b/device/testing/device-samsung-starqltechn/payload_mock.dts @@ -0,0 +1,9 @@ +/dts-v1/; +/ { + memory { + /* We expect the bootloader to fill in the size */ + reg = <0 0 0 0>; + }; + + chosen { }; +}; \ No newline at end of file