Meizu 16th (meizu-m1882)

Contributors

 * ChPu437

How to enter flash mode
Press and hold and  when the phone is off to enter fastboot.

Installation
(If there's only one contributor, all the "I" refers to ChPu437, if else, then plz contact me to replace them. I know this is inappropriate but forgive me plz XD)

Generally, just simply follow SDM845 Mainlining Guide until you got a boot image, but you DO need some little modification to really boot PostmarketOS with a working framebuffer.

During "Creating a framebuffer" section, you'll need to do some extra modification to the template dts node, to keep it simple, just follow these steps instead.

Insert these under the  node:

ranges;
 * 1) address-cells = <2>;
 * 2) size-cells = <2>;

framebuffer0: framebuffer@9d400000 { compatible = "simple-framebuffer"; reg = <0x0 0x9d400000 0x0 (1080 * 2160 * 4)>; width = ; height = ; stride = <(1080 * 4)>; format = "a8r8g8b8"; };

And for the  node, use this instead:

reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges;

linux,cma { compatible = "shared-dma-pool"; alloc-ranges = <0 0x00000000 0 0xffffffff>; reusable; alignment = ; size = ; linux,cma-default; };

framebuffer_region@9d400000 { reg = <0x0 0x9d400000 0x0 0x02400000>; no-map; }; };

For the kernel to generate the initramfs,  would be okay, you can also use the kernel you've been working on above, there won't be many differences at this moment, as the phone can almost only boot.

Continue follow the guide until the  process. Since the phone cannot be directly booted by, this is what you should do: fastboot flash boot mainline-boot.img

Then reboot the device, and you will get a few penguins with dmesg scrolling up on the display if nothing goes wrong.

Status
Though you'll get some errors during the bootup (probably caused by the dts), the phone can boot with a framebuffer and *potentially* usb networking support

Known issue

 * As you can see, most of the hardware didn't work now, especially touchscreen, which is important to interact with a smartphone.
 * Though framebuffer works, it gets a rather poor refresh rate at approximately 1 frames per sec. This was once reported in another project trying to port WoA(Windows on Arm) to SDM845-based devices, but it seems that they managed to solve this. Maybe this can be of great value in reference.

Note on usb networking
Enable  and   and use the common kernel to build initramfs, then you should get usb network and ssh working.

Note on partition layout
For I need to use the phone both porting and daily use, I shrinked my  and created 2 new partitions for   partition and the rootfs. Other layouts should be fine if they don't go against the partition layout.