[Meizu M3 Note Guides, News, & Discussion] 99degree:
Welcome back.

I find it very difficult to make MTK soc working with custom build kernel. Although newer soc do treble in descent shape. I still don't advice to go further. If you still interested in dive deep. You can continue read below.

Make a working twrp img for your device (with original kernel). You will find some dmesg letting you know your LCM model info. Sometimes you will find a same LCM in other model/brand. Not joking, this is limited LCM model manufacture. So LCD panel maker, they have limited choice. Make that procedure simple with other dev's twrp build for same/similar SOC. unpack the boot.img, replace kernel from your original rom, modify recovery.fstab file, take care for boot cmd, for TWRP. You can do it with cfig/Android_boot_image_editor from github. I prefer to use fastboot to test the kernel+ramdisk+cmdline+dtb combination this way.

I did overcome this source issue for custom kernel by searching github (you might have to search for the whole internet in worse case). Although Meizu shared their old kernel for, Meizu M3 note, say this particular old model; it's source didn't work at all. github.com/micode is one of a good place for kernel source. Lucky sometimes there are people sharing their kernel source code this way. I got Meizu M3note (3.10 kernel) with other unknown brand, same SOC kernel version 3.18. I port those LCM, old charger IC driver thus can boot recovery this way. Newer MTK SOC might have different power-supply driver architecture and moved those driver to ARM8 EL1 lk trusty whatsoever, not sure, no idea.

To overcom LCM issue is to think out of box. First method is Go and search as much as you can for kernel source tree, similar/same SOC(different vendor) are equally important.

Then you had better see if you are running fine with phh android 10 or 11(or other custom rom with same SOC and transplant to your phone) with your original kernel first. This is an important step because I experienced flyme launcher show up but constant reboot failing with flyme for exception on kernel call (Meizu's original rom preventive protection) on debugging Meizu E3 init with my built kernel. I eventually boot with a Nokia 6 and XiaoMi A2 (jasmine_sprout, simpler because more AOSP centric) custom lineageos rom up (to at least get adb boot fine for debug) and later switched to Yandex Amber rom for full function.

When you find it is the time to port new kernel, then you can do research for your LCM model. Since sometimes they shared same LCD panel for Successor/Predecessor model, sometimes Some model have many vendor LCM for same model; on the other hand, similar model/different brand, will highly likely share same LCM code and live in same tree. Fork the source to your github repostory. Last method is more technically, You know Image.gz is gzipped elf, you can do 'strings vmlinuz' to grab your LCM name. then use aarch64 objdump to locate the LCM driver's init struct. compare the data with similar LCM driver soure you had. You can compile a similar kernel and exercise this technique and check the data pattern of the struct in hxd tool. Do write it your own later. You can confirm the LCM name is more less same to the struct name. My experience tell me that init/probe function are similar (virtually same except that gpio-pin init for v3.10 to v3.18, same procedure for same SOC with same kernel version, even for different LCM driver, the different is init reg write) so the init/probe struct are essential. Some great dev does this successfully in early kernel v3.4 mtk chip. If not porting LCM, framebuffer driver will as quick reboot as possible.

Then the charger driver, It is located in i2c bus and lacking a driver also reboot too. By doing similar procedure as above, and commenting mt_charging/mt_power_supply reboot code, you might be able to gets in twrp adb with your own kernel.

In case you wanted to get a super quick test, see what kind of i2c device id (from dts/dtb) of your charger ic, use compile similar driver to fill the gap and make sure hardcode to with different id so it wont fire i2c cmd up and ruin your charger/phone. different id for i2c cmd will cause device reject without error. This is the trick and you can have a working kernel which is lacking power supply support only.

Up till here, I believe you will have a working custom ROM, congratulations. You can try to make it more treble compatible like I did for Meizu E3. This stage you can go back step and see if it work with original flyme rom with this new kernel. since it is important for further treble operation for its vendor partition split for binary files.

Best wishes,

99degree