A guide to mainlining android phones

So you can do it too

Homebillie2 infoAboutContact
  • PMIC ADC and Thermals

    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

    Published 6 August 2022

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged adc, cooling, pmic, thermal zone, trip point

  • 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 1. bootloader starts linux kernel, passing along initfs 2. kernel does some bookkeeping and then enters initfs environment 3. initfs job is to prepare… Continue reading initfs Refresher

    Published 25 July 2022

    Categorized as Mainlining Journey

    Tagged boot, cpio, initfs, postmarketos

  • 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)

    Published 29 August 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged power, regulator, rpm, smd, spmi

  • 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

    Published 4 July 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged driver, phy, ufs

  • 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)

    Published 28 June 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged corner, floor corner, floor level, level, power supply, regulator, rpmpd, smd

  • 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

    Published 17 June 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged gpio, module, nc, pinctrl

  • 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

    Published 13 June 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged gcc, phy, rpmcc, usb

  • 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

    Published 2 March 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged first boot, interrupt controller, mainline, ramoops, simple framebuffer

  • 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

    Published 1 March 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged downstream kernel, dynamic partitions, initfs, 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

    Published 22 February 2021

    Categorized as Mainlining Journey, OnePlus Nord N100

    Tagged downstream, gcc, kernel, linux, mkbootimg, oneplus, oppo

← Older posts

Recent Posts

  • PMIC ADC and Thermals
  • initfs Refresher
  • Regulators (SPMI/SMD)
  • UFS phy driver
  • RPM power domains (rpmpd)

Archives

  • August 2022
  • July 2022
  • August 2021
  • July 2021
  • June 2021
  • March 2021
  • February 2021

Categories

  • Mainlining Journey
  • OnePlus Nord N100

Meta

  • Entries feed
A guide to mainlining android phonesRSS feed