In this short post, I’ll share what I learned setting up ADC (analog-digital converter, used for measuring temp and voltage) and Thermal Monitor (notify kernel when stuff gets hot). Setup From what I can gather this applies to QCom SoCs/PMICs, so keep that in mind before you fry your non-QCom device. SoCs have a few… Continue reading PMIC ADC and Thermals
Category: Mainlining Journey
initfs Refresher
In this short post I’ll cover some material about initfs, which could be helpful during (or, more likely, not knowing it will be detrimental to) early mainlining. Background Linux boot process bootloader starts linux kernel, passing along initfs* kernel does some bookkeeping and then enters initfs environment initfs job is to prepare the actual boot… Continue reading initfs Refresher
Regulators (SPMI/SMD)
Overview Regulators are responsible for providing power to various components. It is the last essential piece of the puzzle for early mainlining, that will lay the groundwork for the rest of the port. NOTE: These instructions apply for SPMI/SMD regulators, I haven’t researched in depth the other combinations (newer higher end chips user RPMH in… Continue reading Regulators (SPMI/SMD)
UFS phy driver
Overview UFS stands for Universal Flash Storage, and is a replacement (or enhancement) over SD protocol for storage. The hardware is present for 2-3 years in phones now but most likely lacks any actual storage attached, so it wasn’t really necessary to concern oneself with UFS for mainlining up until recently. It contains a core… Continue reading UFS phy driver
RPM power domains (rpmpd)
Overview On downstream power domains and regular regulators are somewhat mixed together (like this). On mainline, power domains go in one place and regulators in another, because it turns out, they are completely different beasts. I can’t really explain what the difference is, but power domains are like a cooktop you can configure from 0… Continue reading RPM power domains (rpmpd)
Add pinctrl driver
Overview If you have played with arduino or rpi you might have come across the concept of pins to get input from sensors or control stuff (like relays or motors). Modern SoCs have hundreds of those, and each needs to be configured appropriately so the device that is attached on the other end behaves accordingly.… Continue reading Add pinctrl driver
Enable USB networking
Hello old friend Sorry for the big delay between posts. I got caught up with some other work. In fact I had most of the work done 3 months ago, and there were some finishing touches left, but when I resumed on my journey I figured I can’t even run the mainline kernel as I… Continue reading Enable USB networking
Booting mainline kernel
I really didn’t expect this to be so easy, that it will be covered in a single post, but it actually is, so here we go. Overview It turns out to boot linux on a device you don’t need much. To be more specific you need to specify the following DT nodes: cpu – number… Continue reading Booting mainline kernel
Running stock kernel on PostmarketOS
Why are we doing this? In last post we finished by testing our newly build stock kernel. We used stock Android userspace, which is not ideal, because when we start actual mainlining the userspace will be PostmarketOS, so it would be good if we had some indication that the userspace was OK (so we’re not… Continue reading Running stock kernel on PostmarketOS
Building stock kernel
The next step in mainlining is to build the original/stock/downstream kernel. We’ll use it as a reference point and to extract additional details when the need arises. The stock kernel’s source is provided by the manufacturer, so building it should be relatively easy. Overview This shouldn’t be complicated, here is the battle plan: find and… Continue reading Building stock kernel