Repository navigation
Conversation
The SM6125 (trinket, Snapdragon 665) board, built on upstream's sm6125.dtsi. The display is a DSI video-mode AUO FT8756, 1080x2300, and the touchscreen a FocalTech FT8756 on the QUPv3 SE2 SPI controller. The SM6125's Adreno 610 needs the GPU clock controller, the GMU wrapper and its own SMMU; upstream's sm6125.dtsi carries none of them, so they are described here, as in the mainline SM6125 port for the Redmi Note 8T. The panel and touch timings and the command sequences come from Motorola's own device tree (MotorolaMobilityLLC/kernel-msm, tag MMI-QPE30.79-41). Two drivers come with it: - drm/panel: panel-auo-ft8756.c, the AUO FT8756 in video mode - input/touchscreen: focaltech_ft8756.c, the FocalTech FT8756 over SPI Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bootloader applies the dtbo partition's overlay to whatever base DTB the boot image carries, so the board's identity properties matter: the msm-id, msm-name, pmic-name and board-id. Also give the board a simple-framebuffer over the cont_splash region, so the first-light initramfs has a console to write to. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three things kept the kernel from starting on this phone, all found by comparing our device tree with the one the phone actually runs. The memory node has to be called exactly "memory". The bootloader fills the RAM map in by looking that node up by name, with no unit address: the stock tree has a node named "memory" and the live tree shows it patched with the real four-bank map. Ours was called memory@0, so the bootloader never patched it and the kernel came up with no memory at all and died before anything else. The SoC dtsi's own memory@40000000 placeholder is deleted for the same reason: two memory nodes would leave the kernel with the wrong map. The console UART was disabled, and the earlycon named a UART that is not there. The stock tree puts its console on the QUPv3 SE4 UART at 0x4a90000, which is where upstream's uart4 is, so stdout-path points there now, uart4 is enabled, and the earlycon names qcom_geni at that address. The USB controller was not enabled at all, so the initramfs could never bring its gadget up. The DWC3 parent and the QUSB2 PHY are both enabled now, and the DWC3 stays in peripheral mode, which is what the phone needs when it is a USB device on the host side. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you, James, and welcome. A first board for a Snapdragon phone is a big step, and I appreciate that the commit messages explain what you found by comparing with the phone's own tree. I ran our gate and dt-validate on it. Before I go further, there are a few things that block it, the first one of which only you can fix:
Smaller things for the next push:
CI is waiting for my approval. I'll approve it once the sign-offs are in. |
…lators Five things kept the board's hardware from working, all measured against Motorola's own device tree and upstream's tree for the same PM6125. The regulator table was not this phone's. It gave the PM6125's rails the voltages of some other chip: L10, L11 and L15 came out at 330 mV where Motorola's tree says 1.8 V and 3.1 V. The USB PHY is fed by L10 and L15, so it was being handed rails it cannot run on. The table now matches Motorola's (trinket-regulator.dtsi) and upstream's tree for the same PM6125 (sm6125-xiaomi-ginkgo-common.dtsi), which agree with each other. The eMMC is sdhc_1, at 0x4744000, not sdhc_2: the stock kernel's command line says "androidboot.bootdevice=4744000.sdhci" and Motorola's tree has sdhc_1 there. It also needs the two rails upstream gives the eMMC on the Redmi Note 8, the same PM6125: L24 (VMMMC) and L11 (VQMMVC). The SPMI arbiter was disabled, so neither the PM6125 nor the PMI632 probed and none of the PMIC's rails or GPIOs were there. Both QUPv3 wrappers were disabled, and the console UART (uart4) and the SPI controller the touchscreen is on (spi2) are inside the first of them: a node below a disabled wrapper never probes. The GPIO DMA controller was disabled, and the QUPv3 SPI transfers need it. The USB PHY is now given its three rails (L7, L10 and L15), which the driver gets with a bulk regulator get that fails outright when a supply is missing. The memory map, the console and the USB controller were fixed in the previous commit; this one is what the board's hardware needs to come up at all.
The bootloader arms the hardware watchdog before it hands over to the kernel, and a kernel that does not take it over is reset while it is still starting up: on the Motorola Moto G Power (2022) the phone came back to the bootloader nine seconds into every boot, before anything had been printed anywhere. Motorola's own device tree describes the watchdog as "qcom,msm-watchdog" at 0xf017000, with a bark time of 11000 ms and a pet time of 9360 ms (arch/arm64/boot/dts/qcom/trinket.dtsi in MotorolaMobilityLLC/kernel-msm, tag MMI-QPE30.79-41). Upstream has no driver for it, so a mainline kernel on this phone never takes it over. This driver takes it over and stops the timer the bootloader left running. Arming it again, with a heartbeat, is not implemented yet: the bring-up needs the kernel to keep running, and a watchdog that resets the phone in the middle of a debug session is not what the port wants yet.
The bootloader arms the watchdog and a kernel that does not take it over is reset 9360 ms into the boot. Writing the magic that stops the timer also touches a register that resets the SoC if the offsets are not what they are thought to be, so feed the timer every two seconds instead.
The offsets were wrong. The watchdog on this SoC is the one Motorola's own driver for it uses (drivers/soc/qcom/watchdog_v2.c in the kernel-msm tree, tag MMI-QPE30.79-41), and its registers are: WDT0_RST 0x04 write one to it to pet the timer WDT0_EN 0x08 WDT0_STS 0x0c WDT0_BARK_TIME 0x10 WDT0_BITE_TIME 0x14 Petting the timer is a write to WDT0_RST, followed by a write of zero to WDT0_EN: the countdown that matters is the secure side's, and the write to the reset register is what asks it to start over. The previous version wrote to 0x10, which is the bark time: it set the bark time to one tick and enabled the watchdog with it, and the phone was reset a moment later.
|
Thank you, James, for the new commits. Enabling the QUPv3 wrappers and giving the USB PHY its three rails fixes two of the things I'd pointed at, and the regulator table now looks like the PM6125's. Before anything else, though, two things in this push worry me for your phone more than for the code.
I know that's a long list again. If it would help, I'm happy to start the |
Add support for the Motorola Moto G Power (2022) ("sofia")
The Moto G Power (2022) is an SM6125 ("trinket", Snapdragon 665) phone on
Motorola's ABL-derived MBM bootloader. This adds the board device tree and
the three drivers it needs that upstream does not carry:
panel-auo-ft8756: the AUO FT8756 DSI panel, 1080x2300, video mode.focaltech_ft8756: the FocalTech FT8756 touchscreen, on the QUPv3 SE2SPI controller at 0x4a88000.
qcom-msm-wdt: the hardware watchdog at 0xf017000, which thisbootloader arms before it hands over to the kernel and resets the
phone 9360 ms into the boot if the kernel does not take it over.
The board device tree also carries the SoC identity the bootloader matches
on. This bootloader is not Google's ABL: it resolves the hardware to a
product name with its own board-ID table and looks for a
dtboentry whoseroot
modelis that name and whose rootqcom,board-idis the highestrevision not newer than the device's. For this phone that is "sofia" at
0x46 0xc000, which is what the tree declares.
The panel and touch nodes carry the values read off the handset's own
vendor device tree: the DSI controller at 0x5e94000, the PHY at
0x5e94400, the touchscreen's interrupt on TLMM 88 and its reset on TLMM
87, and the panel's 1080x2300 geometry.
The tree also carries what this bootloader and this board need, which
took a while to measure:
address: the bootloader fills the RAM map in by looking that node up
by name.
tree gives them. The USB PHY is fed by L10 and L15.
(VMMMC) and L11 (VQMMVC) rails.
have to be enabled: a node below a disabled wrapper never probes.
with a bulk regulator get that fails outright when one is missing.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com