mobile-nixos icon indicating copy to clipboard operation
mobile-nixos copied to clipboard

amazon-karnak: init

Open zhaofengli opened this issue 2 years ago • 4 comments

Early WIP for the Amazon Fire HD 8 (8th generation) aka karnak.

Working

  • [x] Boot
  • [x] Wi-Fi

Not Working

  • [ ] Framebuffer Console
  • [ ] Mali GPU
    • Need aarch64 Linux blobs
    • This device has a Mali-T720 which is supported by panfrost. However, we are currently stuck with 4.9 and backporting appears to be difficult.

Not Tested

Anything else

Howto

As framebuffer console isn't working, you will need to open up the device and solder 2 wires onto the UART test pads on the back of the main board. In order to expose the back of the board, the speaker wires have to be desoldered first. The test pads are clearly marked with "RX" and "TX". The baud rate is 921600.

Flashing of boot.img must be done with TWRP which is patched to automatically inject the Amonet payload. If you directly write to boot, you must then flash a dummy .zip to trigger the patching or perform the steps here.

Misc. Resources

  • https://wiki.postmarketos.org/wiki/Amazon_Fire_HD_8_2018_(amazon-karnak)
  • https://wiki.postmarketos.org/wiki/Amazon_Fire_HD_8_2017_(amazon-douglas)
  • https://wiki.postmarketos.org/wiki/WiFi#Mediatek_WiFi
  • https://github.com/testandroidtests/asus_p00c_2_dump (Dump of another MT8163 device with 64-bit userland)
  • Amazon source release

zhaofengli avatar Aug 24 '21 17:08 zhaofengli

And now we have Wi-Fi working! Turns out openmttools is a sufficient replacement for the proprietary wmt_ binaries and can initialize the chips over SDIO BTIF just fine. For now, we are using the binary .ko files from android_vendor_amazon_karnak until we integrate the modules into the kernel tree.

With functional networking, now we can finally test things at a much faster pace.

zhaofengli avatar Aug 25 '21 02:08 zhaofengli

Nice!

I hadn't taken a look at Wi-Fi on any MTK devices, good work!

Can we get a quirk + service for Wi-Fi, like there is for qualcomm? Hopefully I can validate on the two 64 bit Mediatek devices.

samueldr avatar Aug 25 '21 03:08 samueldr

Can we get a quirk + service for Wi-Fi, like there is for qualcomm? Hopefully I can validate on the two 64 bit Mediatek devices.

Generalizing this can be difficult because different devices may require a different set of kernel modules (e.g., some have wlan_drv_gen4 instead of wlan_drv_gen2) and openmttools only works with BTIF (which appears to be just a specialized UART interface) and does not implement MediaTek's UART STP protocol (if you have more than one ttyMT* device, then it probably uses UART for the chips). The current implementation for karnak can be found here.

zhaofengli avatar Aug 25 '21 05:08 zhaofengli

Hi!

We just had some major~ish changes, at least one affecting new ports. I would heavily suggest rebasing on top of the latest master update.

The main change affecting ports is that we now have required kernel configuration options, which set known good values to a lot of "difficult to guess" options. A simple bin/kernel-normalize-config should be all that is needed.

Hope this helps!

samueldr avatar Aug 31 '21 19:08 samueldr

Hi! :wave:

I have taken the (not so hard) decision to drop support for vendor-based devices.

I'm closing this PR since it only targets working with vendor-based devices. It is not a judgement of the quality of the changes, but really that I don't think it's healthy to keep hoping they may end-up working fine in that state.

Though, it doesn't mean there's no hope to ever see these devices end-up useful. Far from it. But to see them being useful, work on mainline Linux and other projects will need to happen.

Thank you for your understanding,

(See also: #643)

samueldr avatar Sep 14 '23 19:09 samueldr