xiaomi-scorpio (Mi Note 2, MSM8996Pro): Mainlining Attempt
Current status: Kernel stdout visible on screen with panel driver, UFS works to some extent.
What I've done so far:
- Added a dtsi for the device, and a dts with board-id/msm-id/pmic-id.
gpio_keys(disabled for now since I have no way of testing them)
- Reserved memory
- Panel (LG Display SW43101 FHD) driver, and related nodes in the device tree
simplefb(now unused since the panel driver works)
- UFS nodes in device tree
- Fixed display issues
Things I've tried to get it to boot:
- I looked at the bootloader binary (aboot), and from the strings I found, it seems that it looks for a panel node according to a lookup table, and it has an error string for when it doesn't find it, so I added a stub
qcom,mdss_dsi_lgd_sw43101_fhd_videonode, but it didn't change anything.
- I copied
chosenfrom downstream, still the same.
Update 1: Turns out it actually boots, but initializing the mdp smmu makes the whole thing crash. Implementing
qcom,no-smr-check stops it from crashing.
Now it initializes the iommus without crashing, but then the display turns blue then fades out until it becomes totally black. I don't have USB networking or pstore so I'm not able to understand exactly what's happening.
Update 2: I added a hook to initfs that writes dmesg to /cache, and that allowed me to get logs with adb shell from TWRP.
As for the display issues, I found that the mdp smmu required yet another
qcom,register-save quirk to be implemented from downstream to make it stop killing the display. I also had to set DRM_MSM to be built-in instead of a module, and enable a bunch of PMIC related configs that were disabled, then define vdd-gfx and give it to mmcc. I got the display to work properly with the panel driver after all of this.
Now I'm dealing with UFS. It can see and list all available partitions, and write to /cache, but it crashes when trying to resize rootfs. I made initfs skip resizing, but then I get a bunch of I/O errors from OpenRC, and I end up with a login prompt which I have no way of typing in since USB doesn't work yet. Isn't it supposed to auto-login? My guess is that it has to do with the I/O errors.