Skip to content

WIP serial: Add framebuffer uart driver#38

Open
minlexx wants to merge 30 commits intomaster-sdm660from
alexeymin/fbserial
Open

WIP serial: Add framebuffer uart driver#38
minlexx wants to merge 30 commits intomaster-sdm660from
alexeymin/fbserial

Conversation

@minlexx
Copy link
Copy Markdown
Member

@minlexx minlexx commented Nov 4, 2025

The serial framebuffer can be sometimes useful for debugging early boot failues since it registers as a debug UART.

Kind of works, experience is very rough though and screen with small letters is hard to read.

In current state, conflicts with simplefb video driver look unsolvable. Needs more work

@minlexx minlexx force-pushed the master-sdm660 branch 2 times, most recently from fc3ca07 to 602e19a Compare November 6, 2025 04:52
@minlexx minlexx force-pushed the alexeymin/fbserial branch from dda1acb to 03afb4d Compare November 6, 2025 05:22
@minlexx minlexx force-pushed the alexeymin/fbserial branch from 03afb4d to 4250fe5 Compare November 7, 2025 22:05
@minlexx minlexx force-pushed the master-sdm660 branch 3 times, most recently from 2b85665 to 58ba67a Compare December 2, 2025 02:30
@minlexx minlexx force-pushed the alexeymin/fbserial branch from 95934c9 to bb933c4 Compare December 2, 2025 02:30
minlexx and others added 18 commits December 9, 2025 11:11
Simple build script for PRs.
Also create Android boot images for merge request's CI.

And add auto-rebaser job, which will run rebase on upstream/master
once a day to try to see if there are some incompatibilities with
upstream.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
…UFS devices

Currently (since 2026.01-rc) on all SDM630/660 based devices this is
printed, after observing long boot delay (several seconds) before
executing preboot commands:

 QCOM-FMP: Failed to find boot partition

find_target_partition() function incorrectly assumes that eMMC is always
at number 0. In general you can't rely on device numbering to determine if
particular block device is eMMC or SD-card, because it depends on how
aliases are defined in device tree "chosen" node. Some SoCs have MMC
numbers starting at 1, not 0; so mmc1 is eMMC, mmc2 is SD-card.

Make eMMC detection reliable by using IS_SD() macro from mmc.h header.
Using this method target boot partition can be found successfully.
With debug prints enabled, this is printed:

 QCOM-FMP: skipped SD-Card (devnum 2)
 QCOM-FMP: Capsule update target: boot (disk 1:60)
 QCOM-FMP: DFU string: 'mmc 0=u-boot.bin part 1 60'

Without debug prints nothing is printed, no error about failure to find
boot partition.

Fixes: fe80a5f ("mach-snapdragon: CapsuleUpdate: support all boot methods")
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Add default env file for sdm660 phones.

Place all our options to 2 fragments:
 * qcom-sdm660-phone.config - default
 * debug-sdm660.config - additionally debug UART

To build for SDM660, use "make qcom_defconfig qcom-sdm660-phone.config"

Co-developed-by: Paul Sajna <hello@paulsajna.com>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Sometimes it's needed to keep serial port setup to whatever was
configured by previous bootloader to see boot logs.

Honor the existing Kconfig option to enable this behaviour.

Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
This works around bug in serial_msm driver incorrectly assuming that
default rate of 7372800 suits everyone. For SDM660 however the correct
uartclk is 1843200, as reported by Linux driver (when booted w/o U-Boot):

  msm_serial c170000.serial: msm_serial: detected port #0
  msm_serial c170000.serial: uartclk = 1843200

Rate of 1843200 allows serial_msm driver to calculate the correct
divider value of 16 (1843200 / 115200) for clock select (CSR) register,
which matches stock bootloader programmed value: 0xff.

Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Clearly state that serial_msm is about "older" UART DM (Data Mover)
driver, to reduce confusion with the "newer" GENI one.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Clearly say whether it's stuck during power on or power off.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Apparently not all GDSCs are the same. In Linux driver, depending on which
GDSC flags are set, different status register is checked when powering it
on/off. And on top of that, different bit inside that register is tested.

Port missing parts from Linux driver to U-Boot:
 - add GDSC flags;
 - adjust logic when checking GDSC status to match one in Linux driver.

This fixes e.g. SDM660's USB_30_GDSC to be forever stuck during power on,
since unlike SDM845 one it doesn't have POLL_CFG_GDSCR flag.

Even though only POLL_CFG_GDSCR is the important one here, add all flags
from Linux driver, to make it easier to compare which flags are needed
for which GDSC, making porting process easier.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Now we need to specify flags for each GDSC for it to function properly.
Copy .flags field from respective Linux GCC driver.

Turns out, even among SDM845 not all GDSCs are the same. Some of GDSCs
do specify the POLL_CFG_GDSCR flag that changes the logic to check the
ON/OFF status, other don't.

Some qcom clock drivers in U-Boot don't specify any GDSCs at all
(apq8016, apq8096, ipq4019, qcs404), or GDSCs in their linux GCC driver
don't specify any flags (qcm2290, sm6115) thus making them unaffected
by this change.

Add flags to all other SoC's GDSCs currently present in U-Boot that do
need this change.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Add driver for Global Clock Controller used in Qualcomm
SDM630/660 SoCs.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Add new stdio device driver that allows to store console messages in
persistent ram console zone.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Inceasing number of mmc partitions to scan is important one,
system or userdata partition have number > 60, which is way
above 30.

Removing the default BOOTFLOWIF_ONLY_BOOTABLE flag allows
us to scan every partition in `bootflow scan -lb` command,
not only those with "bootable" flag set.

The addition of `bootmeth_setup_fs()` was needed IIRC to fix
some nullptr deref somewhere, to fully reinit some struct
fields, not sure if it's still needed?

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
SPMI PMIC arbiter V3 is using the same offset calculations as V2.
But it needs to scan 512 periperals into channel_map.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Allow to use PMIC GPIOs on SDM630/660 platforms.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Add pinctrl pinconf for volume_up gpio

HACK because probably it's not correct thing to do, we shouldn't be
fixup up upstream DTs, fixes shold go upstream or applied as *-uboot.dtsi
maybe?
minlexx and others added 11 commits December 9, 2025 11:12
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
These will be used as base for devices whose device trees are not
yet upstream in Linux kernel.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
This is combined DT for both clover & clover-plus  devices -
differences between them are not relevant to U-Boot.

Additionally these DTs have all msm-serial interfaces disabled:
* debug UART was never enabled in the first place
* Bluetooth UART was explicitly disabled to fix probe errors
  with qcom_sdm660_clover_defconfig (due to CONFIG_SERIAL_PRESENT
  being not set).

Separate config fragemnt for ramoops debugging.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
+Separate config fragment for ramoops debugging.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: iAboothahir <aboothahirpkd@gmail.com>
Signed-off-by: Antony K. S <postmarketos@smankusors.com>
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
update compatibles for boe panel variant, add athena

Signed-off-by: Paul Sajna <hello@paulsajna.com>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Signed-off-by: N1kroks <nikroksm@mail.ru>

WIP serial framebuffer hacks

The serial framebuffer can be sometimes useful for debugging early boot
failues since it registers as a debug UART.

Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
@minlexx minlexx force-pushed the master-sdm660 branch 3 times, most recently from 8f54e9d to be3dc8b Compare January 17, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants