From e345f8fae1d4bc417f94c74e746b44b67d0f6133 Mon Sep 17 00:00:00 2001 From: Yassine Oudjana Date: Sun, 13 Sep 2020 19:13:48 +0400 Subject: [PATCH] samsung-grandpplte: new device (MR 3475) Add device package for Samsung Galaxy Grand Prime+ (grandpplte). This device uses U-Boot as a secondary bootloader. --- .../device-samsung-grandpplte/APKBUILD | 49 +++++++++++++++++ .../device-samsung-grandpplte/boot-image.its | 52 +++++++++++++++++++ .../device-samsung-grandpplte/boot.cmd | 2 + .../device-samsung-grandpplte/deviceinfo | 35 +++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 device/testing/device-samsung-grandpplte/APKBUILD create mode 100644 device/testing/device-samsung-grandpplte/boot-image.its create mode 100644 device/testing/device-samsung-grandpplte/boot.cmd create mode 100644 device/testing/device-samsung-grandpplte/deviceinfo diff --git a/device/testing/device-samsung-grandpplte/APKBUILD b/device/testing/device-samsung-grandpplte/APKBUILD new file mode 100644 index 000000000..aefa40f81 --- /dev/null +++ b/device/testing/device-samsung-grandpplte/APKBUILD @@ -0,0 +1,49 @@ +# Reference: +pkgname=device-samsung-grandpplte +pkgdesc="Samsung Galaxy Grand Prime Plus" +pkgver=1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="aarch64" +options="!check !archcheck" +depends=" + dtc + linux-postmarketos-mediatek-mt6735 + mkbootimg + mt6735-bootshim + postmarketos-base + u-boot-grandpplte + u-boot-tools +" +makedepends="devicepkg-dev" +source=" + boot.cmd + boot-image.its + deviceinfo +" + +build() { + devicepkg_build $startdir $pkgname + + cat "/boot/bootshim" "/usr/share/u-boot/grandpplte/u-boot.bin" \ + > "$startdir/u-boot-shimmed.bin" +} + +package() { + devicepkg_package $startdir $pkgname + + mkdir -p "$pkgdir/usr/share/u-boot/grandpplte/" + install -Dm644 "$startdir/u-boot-shimmed.bin" \ + "$pkgdir/usr/share/u-boot/grandpplte/" + install -Dm644 "$srcdir/boot.cmd" \ + "$pkgdir/usr/share/u-boot/grandpplte/" + install -D -m644 "$srcdir/boot-image.its" \ + "$pkgdir/usr/share/u-boot/grandpplte/" +} + +sha512sums=" +7c44c3ebf446083853a9e343f397406a4176118c23bfcf564392dd9ac00208fe63cab56870269e2ff8b9db181f039fd945991d7b3faea196ef2a8902017a6aa7 boot.cmd +8226a99856b5613c5f4a9bb4314c1bfad676126df1260381baf40b92b201aa460522998b87b1b50b7ce31cd688d023d3bf4bae0977d7d586268c63e719e6770a boot-image.its +3418aafdcbff0cbfbadfa0a6e4b075c9667f56306bed6da1ba9658ac817eaba797d4b3acfb8d1dad1538841291c2166644617882529c9e083e23866cfc2df4fb deviceinfo +" diff --git a/device/testing/device-samsung-grandpplte/boot-image.its b/device/testing/device-samsung-grandpplte/boot-image.its new file mode 100644 index 000000000..c47eac82f --- /dev/null +++ b/device/testing/device-samsung-grandpplte/boot-image.its @@ -0,0 +1,52 @@ +/dts-v1/; + +/ { + description = "Samsung Galaxy Grand Prime+ FIT"; + #address-cells = <1>; + + images { + bootscript { + description = "Boot script"; + data = /incbin/("boot.cmd"); + type = "script"; + compression = "none"; + }; + + kernel { + description = "Linux kernel"; + data = /incbin/("vmlinuz"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0x40080000>; + entry = <0x40080000>; + }; + + fdt { + description = "Device tree"; + data = /incbin/("/boot/dtbs/mediatek/mt6737t-samsung-grandpplte.dtb"); + type = "flat_dt"; + compression = "none"; + }; + + initrd { + description = "Initramfs image"; + data = /incbin/("initramfs"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + }; + }; + + configurations { + default = "standard"; + + standard { + description = "Standard boot"; + kernel = "kernel"; + fdt = "fdt"; + ramdisk = "initrd"; + }; + }; +}; diff --git a/device/testing/device-samsung-grandpplte/boot.cmd b/device/testing/device-samsung-grandpplte/boot.cmd new file mode 100644 index 000000000..fd69eed10 --- /dev/null +++ b/device/testing/device-samsung-grandpplte/boot.cmd @@ -0,0 +1,2 @@ +setenv bootargs 'console=tty0 clk_ignore_unused PMOS_NO_OUTPUT_REDIRECT PMOS_NOSPLASH' +bootm 0x44000000 diff --git a/device/testing/device-samsung-grandpplte/deviceinfo b/device/testing/device-samsung-grandpplte/deviceinfo new file mode 100644 index 000000000..a121487ae --- /dev/null +++ b/device/testing/device-samsung-grandpplte/deviceinfo @@ -0,0 +1,35 @@ +# Reference: +# Please use double quotes only. You can source this file in shell scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Samsung Galaxy Grand Prime Plus" +deviceinfo_manufacturer="Samsung" +deviceinfo_codename="samsung-grandpplte" +deviceinfo_year="2016" +deviceinfo_arch="aarch64" +deviceinfo_dtb="mediatek/mt6737t-samsung-grandpplte" +deviceinfo_uboot_boardname="grandpplte" + +# Device related +deviceinfo_chassis="handset" +deviceinfo_keyboard="false" +deviceinfo_external_storage="true" +deviceinfo_screen_width="540" +deviceinfo_screen_height="960" + +# Bootloader related +deviceinfo_flash_method="heimdall-bootimg" +deviceinfo_kernel_cmdline="bootopt=64S3,32N2,32N2" +deviceinfo_generate_uboot_fit_images="true" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_dtb_second="false" +deviceinfo_bootimg_override_payload="u-boot-shimmed.bin" +deviceinfo_bootimg_override_initramfs="boot-image.itb" +deviceinfo_flash_offset_base="0x3fffc000" +deviceinfo_flash_offset_kernel="0x00008000" +deviceinfo_flash_offset_ramdisk="0x04004000" +deviceinfo_flash_offset_second="0x00f04000" +deviceinfo_flash_offset_tags="0x0e004000" +deviceinfo_flash_pagesize="2048" +deviceinfo_flash_heimdall_partition_kernel="boot" +deviceinfo_flash_heimdall_partition_system="system"