[8.9" Kindle Fire HD Android Development] ipipipipip:
Hi, everyone.

Some time ago I've been working on getting mainline linux to work on our device.

I was mostly interested in running desktop GNU/Linux, not Android, not in chroot.

I used it in Uni for occasional coding, in order not to carry laptop with me.

I'm not sure if I'll continue to actively develop and maintain it, so I decided to share my work with whoever might be interested in it.

However if there would be community interest, I might continue to improve support.

Or maybe someone would like to help me with this undertaking.

The code is not based on amazon kernel, and don't use legacy board files, but is Device Tree based.

Most of the basic hardware works, however, some don't, and would be nice if someone smarter or more stubborn than me helps to troubleshoot it.

What works:

It boots)

Serial console - needs device disassembly, convenient for debugging

eMMC

Display panel with backlight - 18bit mode, without dithering.

HDMI display (hotplug, modeswitching)

USB device - works as usb cdc, handy for SSH access and configuration.

Charging - uses driver from stock kernel

Battery monitoring - doesn't strictly match android measurements, but works.

WiFi - uses brcmfmac driver, needs firmware, haven't tested it outside of regular client mode, not shure if either hotspot or p2p works.

Bluetooth - needs firmware uploaded from userspace, however may be rewriten with serdev interface.

Touchscreen - uses driver from stock kernel.

Vvolume gpio keys

Power button - connected to power management chip

Vivante gc320 - gives a nice speedup for X11 and Xv scaling.

Hall sensor (protective cover (lid) sensor)

Case thermal sensor

Audio codec - headphones, speakers, microphones not tested

LTE modem - can be used for data and SMS but not calling (unless you figure out how to ). Not sure about positioning (if it is available on this modem)

What doesn't work:

Sound - codec works, but I failed to make it properly communicate with omap, am I missing something obvious? works now: mclk pinmux was misconfigured

Camera - not really interested in it anyway.

RPROC - see notes below

[*] DSP - seems to be not used on stock andoid at all;

[*] IPU - required for camera and video encoding/decoding acceleration

[*] IVA-HD - part of VPU.​

GNSS - provided by the same chip as Bluetooth, but communicates via some obscure protocol from userspace.

PoverVR gpu.

What could be brought up with small effort (supposedly):

Various sensors:

IMU: accelerometer, gyroscope, compass.

Hall sensor - protective cover lid

ambient light sensor

various thermal sensors.

LTE (might actually have GPS in it, or call functionality, who knows...)

Bugs:

Bluetooth needs to be enabled in android prior to (hot) reboot to linux, I'm obviously missing some port configuraion.

USB host technically works, but is disabled since it needs some work. (And it makes high pitched noise while 5v booster is on though)

Suspend/resume mighth not work Should work :silly: (proper power management needs newer u-boot).

Charging sometimes get's limited to 500mA -- smb347 driver needs some debugging.

CPU Idle is disabled, not really shure what's wrong with it.

Frequency scaling is not perfect (since omap4470 is not really supported in mainline kernel).

HDMI DDC - EDID reading corrupted, looks like some issues with ddc pullup/esd protection chip, sometimes it might even work. If someone with osciloscope is interested in debugging, you are welcome. And one more thing: after you reboot back to android hdmi wouldn't work here for some time, untill it gets back to normal. Resolved.

Remoteproc functionality (DSP, IPU) for omap chips is not really present in mainline. It IS in TI kernel, I was able to build firmware for ducati, and run it.

But was unable to make it properly communicate with userspace.

Someone experienced with it might help.

What is unlikely to EVER work:

SGX544sc has no userspace drivers, so unless you have some contacts at TI who would bother to compile it, this gpu won't work.

Camera requires some code running on IPU, which, AFAIK, was never opensourced.

Boot process:

The kernel is booted directly via second bootloader.

For now without initramfs, so it needs a separate partition on eMMC for rootfs.

With initramfs, on the other hand, one may put rootfs on the regular `data` partition, either as file or in directory.

Works nicely along with regular Android: with a small tweak to bootloader you can boot either via volume key combination.

The bootloader is configured to boot from `dkernel` partition if both volume buttons are pressed.

Dkernel partition initially contains kernel for factory device check and is not used in regular device operation. Still, you may wish to back it up if you feel like you may need it at some point.

You may choose whichever linux distribution you like, I'm using archlinuxarm for now.

I'll provide a more detailed manual, and flashable binaries, alongside with rootfs later,

But for now, if you know what you are doing, here are some sources:

kernel (current working branch is `integration-4.18`, use omap4jem_defconfig)

u-boot (will upload source code later, for binary build see attachment)

Basic outline of required steps are:

replace secondary bootloader in your main boot partition

rebuild dkernel, with zImage build from sources and flash it.

shrink your 'data' partition

add new partition on your eMMC for your rootfs and format it to ext4 or f2fs

unpack your rootfs onto it

mount and chroot into it to make basic configuration

boot.

A video demo:

[YOUTUBE]mpjwL4VRS-E[/YOUTUBE]

https://www.youtube.com/watch?v=mpjwL4VRS-E

Have a nice day!