Mainline Linux (postmarketOS) on my Amazon Fire HD 10 (2017). Post #2
Read the first blog post If you haven’t already!
Short recap: In the last blog post, I talked about how I got mainline linux booting on my Amazon Fire HD 10 (2017) Tablet; however, having it booting doesn’t mean we have a fully functioning system yet.
There are a lot of components on the tablet which needed upstream support. For some of them, like the keypad (volume + power keys), there was already a driver that fully matched what was needed, and we just needed to have a “compatible” property on the device tree node. For others, like the MT6397 PMIC’s AUXADC, I had to make an entirely new driver for it, because nothing else quite fit in enough to make a separate driver.
The hardest thing to try and work with was the PSCI firmware on the device. PSCI 1.0 is a requirement for 64-bit ARM devices in the upstream kernel (that, or using a spin-table where the CPU spins on a certain chunk of memory until it has been initialized). The firmware the Fire tablet comes with is PSCI 0.2, and a broken implementation of PSCI 0.2, such that I had to treat it like PSCI 0.1.
The solution to this was either to try to beg the upstream kernel developers to allow me to insert some register writes in the right place to turn the CPUs on, which would be hacky and definitely not accepted, or find a way to get a working PSCI 1.0 implementation prior to the kernel starting.
While I was originally working on upstreaming, I had the hacky workaround that the vendor kernel uses, which is handling the power on sequence with a separate custom method specified in the device tree than psci and spin-table.
More recently, the folks at 0x7E Labs reached out to me after they noticed my upstreaming work, and told me about their exploit amonet koboreru, which lets you replace every step of the boot sequence past the preloader, including ARM Trusted Firmware. This allows me to replace the downstream Amazon TF-A, and replace it with upstream TF-A, which implements PSCI 1.0. Hoorah!
I used the same exploit to get U-Boot running as the secondary bootloader, replacing the stock LK bootloader. The initial MT8173 enablement was done by Jack from the 0x7E Labs group, and I built off of it to get the panel, keypad, and device tree for suez. I’ll be slowly upstreaming those to U-Boot as well, but I’m not in as much of a hurry as the kernel, and I understand the U-Boot patches much less than I do the kernel ones, at the moment.
I have been working on upstreaming most of the bits to the kernel, and some bits have been accepted already, and others are still in-review. My hope is to have an initial device tree for the Fire Tablet in the kernel by Linux 7.5. More realistically if not 7.5, then it will be 7.6.
And here’s a photo of the tablet running Phosh on Nura with Linux 7.3 (formerly postmarketOS)!

If you want to keep up with my kernel patches, this search link will take you to all the mailing list messages referencing me: