mobile: kernel on kernel.org v7.0.14, named 7.0.14-makronix-unstable

The phone kernel no longer builds from the qualcomm-sm8150 fork: the base
is kernel.org stable v7.0.14 (refs/linux/7.0.14, shallow), and what hotdogb
needs from the fork is carried as kernel/patches 0001-0004 (sm8150/PMIC
DTSI nodes, the OnePlus DTS, the SMB5 charger, of/property), unchanged from
its 8e126dbc4; 0005-0025 are our series (the old 0005 is in v7.0.14 by a
stable backport).

The name comes from Makronix's versioning, the files the NetBSD side reads
(src/sys/conf/makronix-release, makronix-codename): kernel_make in
tools/lib.sh gives uname -r 7.0.14-makronix-unstable (x.99.y is -current)
and /proc/version makronix@camouflage, for the build and for every
modules_install.  make update-root defaults to /system/<Makronix version>.

Measured: slot a boots 7.0.14-makronix-unstable with /system/0.99.9,
marked successful; WLAN, Bluetooth, battery and the display work
(build/logs/flash-0.99.9-2026-11-11.log).  docs/NEXT.md 9c has what
7.3.4 showed (ftrace hangs it before the console; without ftrace a hard
freeze later).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Opus 5.5 committed 2026-11-11 14:29:14 +00:00
1 parent cfaba1a630
commit 3b2cbc44f1
39 files changed
+2243 -209

No files matched your search

+4
View File
@@ -16,3 +16,7 @@
url = https://gitlab.nura.eco/soc/qualcomm-sm8150/linux.git
branch = sm8150/7.4-rc1-wip
shallow = true
[submodule "refs/linux/7.0.14"]
path = refs/linux/7.0.14
url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
shallow = true
+13 -7
View File
@@ -47,7 +47,8 @@ quiet change in the tree.
A change that breaks a NetBSD convention is a finding for the report, never a
quiet change.
- `mobile/` is the Linux tree for the phones: sources live in
`refs/linux/7.0.0` (submodule), the changes as `mobile/kernel/patches/`.
`refs/linux/7.0.14` (submodule, kernel.org stable), the changes as
`mobile/kernel/patches/`.
Same model: the imported tree is read-only, our work is in patches.
- `ext/` holds third-party sources that Makronix ships: `ext/src/<name>/` is the
unpacked upstream tree, `ext/src/<name>/pkgsrc/` its recipe, and an `IMPORT`
@@ -131,12 +132,17 @@ lists are written against.
tracked in this repository.
- `pkgsrc/` -- pkgsrc trunk, pinned at `3c1118e94`; its own git repository.
- `refs/netbsd/src` -- upstream NetBSD trunk, shallow submodule, reference.
- `refs/openbsd/src`, `refs/linux/7.0.0` -- OpenBSD and Linux references
(Linux is the tree `mobile/` builds from).
- `refs/linux/7.4-rc1` -- the SM8150 fork's branch `sm8150/7.4-rc1-wip`
(7.4.0-rc1, 38ceee3d0), shallow: the base `mobile/` is being moved to
(`mobile/docs/NEXT.md` §9b). `mobile/kernel/PIN` still names 7.0.0 until
the phone runs 7.4 as well as it runs 7.0.
- `refs/openbsd/src` -- OpenBSD reference.
- `refs/linux/7.0.14` -- kernel.org stable, tag v7.0.14 (458c6079f),
shallow: the tree `mobile/` builds from (`mobile/kernel/PIN`). Since
2026-11-11 the phone kernel has no third-party base: what hotdogb needs
from the SM8150 fork is carried as our patches 0001-0004.
- `refs/linux/7.0.0`, `refs/linux/7.4-rc1` -- the qualcomm-sm8150 fork
(gitlab.nura.eco; 8e126dbc4 and the WIP branch `sm8150/7.4-rc1-wip`),
shallow: kept as the reference the extracted patches came from, not built.
Mainline after 7.0 (7.3.4, measured 2026-11-11) does not boot on hotdogb
with our config yet: ftrace hangs before the console, and without ftrace
it freezes hard later (`mobile/docs/NEXT.md` §9b).
`pkgsrc/` and the reference trees are their own repositories; moving a pin is
a decision. `src/` is ours: a change is a commit here, not a patch.
+7 -4
View File
@@ -74,9 +74,12 @@ here.
## Where the kernel lives (today)
The kernel source is **outside `mobile/`**, one shared Linux tree for the
whole repository: `../refs/linux/7.0.0` (a shallow submodule at the commit in
`kernel/PIN`). `mobile/` holds only the changes: `kernel/patches/` is the
series on top, applied in filename order.
whole repository: `../refs/linux/7.0.14` (kernel.org stable v7.0.14, a
shallow submodule at the commit in `kernel/PIN`). `mobile/` holds only the
changes: `kernel/patches/` is the series on top, applied in filename order.
0001-0004 are what hotdogb needs from the qualcomm-sm8150 fork (taken
unchanged from its 8e126dbc4), 0005-0025 are ours. The old base was that
fork itself (`../refs/linux/7.0.0`); it stays as a reference.
`make linux` clones the shared tree locally (hardlinks, no network) into
`build/linux-<device>` (`KERNEL_TREE`), checks it out at the pin and applies
@@ -84,7 +87,7 @@ the patches; `make kernel` builds the Image, the modules and the device's DTB
(`KERNEL_DTB` in `device.conf`) there. The build tree is output: change it
with commits, then export them into `kernel/patches/` (`git format-patch
--start-number N`). Since 2026-11-08 the DTS of hotdogb is in the series too
(0007); there is no binary DTB any more.
(0010 since the move to v7.0.14); there is no binary DTB any more.
The shared tree is never edited. A pin moves by updating the submodule and
`kernel/PIN` together, with the measurement that justifies it; a drift
+5 -2
View File
@@ -7,7 +7,7 @@
# make flash DEVICE=hotdogb flash it to the test slot (phone in fastboot)
# make rootimg DEVICE=hotdogb root file system image (BASE=void, the default, or debian)
# make roottar DEVICE=hotdogb the same tree as a tar, for update-root
# make update-root DEVICE=hotdogb SYSTEM_VERSION=... unpack it to /system/<v>
# make update-root DEVICE=hotdogb unpack it to /system/<SYSTEM_VERSION>
# and switch /system/current (keeps /data)
# make flash-root DEVICE=hotdogb write it to the root partition (phone in fastboot)
@@ -20,6 +20,9 @@ INITRAMFS ?= build/initramfs-$(DEVICE).cpio.gz
SLOT ?=
BASE ?= void
ROOT_PASSWORD ?= makronix
# the system's version on the phone (/system/<version>) is the Makronix
# version, from the file the NetBSD side reads (src/sys/conf/makronix-release)
SYSTEM_VERSION ?= $(shell cat ../src/sys/conf/makronix-release)
DEV = devices/$(DEVICE)
IMG = build/boot_$(DEVICE).img
@@ -72,7 +75,7 @@ rootimg: kernel
roottar: kernel
sh tools/mkroottar.sh $(DEV) $(ROOTFS) $(KERNEL_TREE) $(ROOTTREE) $(ROOT_PASSWORD)
# needs SYSTEM_VERSION=..., e.g. SYSTEM_VERSION=2026-11-09b; keeps /data.
# SYSTEM_VERSION defaults to the Makronix version (0.99.9); keeps /data.
# Not VERSION: a variable given on make's command line is passed to every
# sub-make, and VERSION is the first line of the kernel's own Makefile --
# make update-root VERSION=2026-11-10a built the kernel as release
+17 -2
View File
@@ -5,7 +5,11 @@ different init sequence; its sequence garbles this phone's display
(measured 2026-11-07).
- `kernel.config` -- the config of the kernel that runs on the phone
(7.0.0-sm8150, display working, ADSP off); since 2026-11-07 with
(since 2026-11-11 `7.0.14-makronix-unstable`: kernel.org v7.0.14 plus
`kernel/patches`; before that 7.0.0-sm8150 on the SM8150 fork; display
working, ADSP off). No `CONFIG_LOCALVERSION` and no
`LOCALVERSION_AUTO`: the name comes from `kernel_make` (`tools/lib.sh`),
out of `src/sys/conf/makronix-release` and `makronix-codename`; since 2026-11-07 with
netconsole (dynamic) and `PRINTK_CALLER`, since 2026-11-08 with msm DRM
built in (`CONFIG_DRM_MSM=y`), dynamic ftrace (function, function_graph),
Landlock, and BTF (`DEBUG_INFO_BTF`, `_MODULES`; needs `pahole` on the
@@ -15,7 +19,8 @@ different init sequence; its sequence garbles this phone's display
`modprobe.blacklist=msm` of the SMMU race (below) is gone since patch 0003.
- The DTB is built with the kernel (`KERNEL_DTB` in device.conf) from
`arch/arm64/boot/dts/qcom/sm8150-oneplus-hotdogb.dts`, which the series
brings in (`kernel/patches/0007`, 0008, 0010, 0012) -- since 2026-11-08.
brings in (`kernel/patches/0002` from the fork, then 0010, 0011, 0015, 0016,
0018, 0019 -- the numbers of the v7.0.14 series) -- since 2026-11-08.
Until then it was a binary here (`DTB_SHA256_PREFIX` 8eb4b7a7c6a6d346,
built from `~/src/sm8150-617`, branch `hotdogb-dts`, commit c4195dd0d,
plus the PON modes by fdtput); git history has it.
@@ -29,6 +34,16 @@ different init sequence; its sequence garbles this phone's display
`mv /system/current /system/broken && mv /system/2026-11-10f /system/current`,
reboot. Before: b9c0aff (085b2284c981fc40), 2026-11-08. Test on slot a
only; slot b is written with `FORCE_FALLBACK=1` and stays inactive.
- Since 2026-11-11 slot a runs `7.0.14-makronix-unstable` with the system
`/system/0.99.9` (`make update-root`, the version from
`src/sys/conf/makronix-release`); measured: boots from slot a, marked
successful (`qcom-ab-slot status`: boot_a retry=6 successful=1), WLAN up
with DHCP, Bluetooth powered with its address set on attempt 1, battery
read (100 %, Full), display by msm DRM
(`build/logs/flash-0.99.9-2026-11-11.log`,
`build/logs/update-root-0.99.9-2026-11-11.log`). Slot b is unchanged
(7.0.0-sm8150, `/system/2026-11-10f`): falling back to it needs the `mv`
above, because /system/current holds the 7.0.14 modules.
## Measured 2026-11-07: Void boots from userdata
+2 -2
View File
@@ -34,8 +34,8 @@ CONFIG_THREAD_INFO_IN_TASK=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION="-sm8150"
CONFIG_LOCALVERSION_AUTO=y
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
+38
View File
@@ -498,6 +498,44 @@ fork's branch is WIP on an rc. On hold until the fork tags 7.4
(`v7.4.0-sm8150`); then rebase kernel/patches-7.4 onto the tag and try
again. Each failed try needs Konrad: Power 15 s (it then boots slot a).
### 9c. 2026-11-11: off the fork, onto kernel.org; 7.3.4 measured
Decision (Konrad, 2026-11-11): no third-party base; kernel.org stable plus
our series, full control. The phone runs **v7.0.14** now (`kernel/PIN`,
`../refs/linux/7.0.14`): 0001-0004 are what hotdogb needs from the fork
(DTSI/PMIC nodes, OnePlus DTS, SMB5 charger, of/property; the fork's 107
files against v7.0 are mostly other devices), 0005-0025 ours (the old 0005
is in v7.0.14 by a stable backport). The fork's 7.4 waiting above is moot;
`kernel/patches-7.4` is history. 7.0 is EOL at 7.0.14: the next base is
the 2026 LTS (likely 7.4 or 7.5), and before that the regression below has
to be found.
What 7.3.4 + the same series (`build/linux-m73`) showed, each from RAM:
- the 2026-11-10 "hang before the console" was two things. With the
fork's DTB ABL never starts the kernel at all (no `qcom,msm-id` /
`qcom,board-id`: `fastboot boot` says OKAY, fastboot stays alive, the
menu stays on screen) -- a fork-DTB test is no test. With our DTB the
kernel starts and hangs.
- our config: black, no USB. The fork's config (defconfig +
sm8150.config): the kernel runs, msm DRM takes the panel (garbled).
Our config with `FTRACE` off: runs too, msm takes the panel -- so ftrace
(dynamic, with call ops, as in 7.0 where it works) hangs 7.3 before the
console. A regression, not found yet.
- without ftrace it freezes hard later: picture frozen, no USB, no panic
with softlockup/hardlockup(buddy)/hung-task panic and panic=10 (cmdline
`build/tmp/dev-panic`), no reset -- so pstore (ramoops at 0xa9800000,
works on 7.0 from 0.046 s) never gets a warm boot to keep the log. A
15 s power press is a cold reset; RAM is lost.
- the screen is no console without msm: 7.0 with
`initcall_blacklist=msm_drm_register console=tty0` boots (ssh) and the
panel stays black, so a black screen on such a test means nothing.
- SoC drivers that changed most from v7.0 to v7.3.4: qcom-pdc (+571, and
sm8150.dtsi's pdc reg 0x30000 -> 0x10000), llcc-qcom (+671), qcom_scm
(+571), ufs-qcom (+632), pinctrl-msm, rpmhpd, qcom-wdt. Cheapest next
tests: DTB-only changes (pdc size back), then a release bisect with the
series (v7.1, v7.2), booting from RAM; a 7.0 phone is put into fastboot
by `reboot-mode bootloader` over ssh, only a hang needs Konrad.
## 10. Where things are (quick map)
| what | where |
+11 -4
View File
@@ -1,13 +1,20 @@
# The Linux tree the phones' kernels are built from: the shared tree
# ../refs/linux/7.0.0 (a submodule, shallow) at KERNEL_COMMIT, plus the
# ../refs/linux/7.0.14 (a submodule, shallow) at KERNEL_COMMIT, plus the
# patches in KERNEL_PATCHDIR, applied in filename order
# (tools/fetch-kernel.sh). Read by sh (`. kernel/PIN`).
#
# The base is kernel.org stable, tag v7.0.14 -- no third-party fork. What the
# phone needs from the qualcomm-sm8150 fork (gitlab.nura.eco, 8e126dbc4) is
# carried as our own patches 0001-0004 (SM8150/PMIC DTSI nodes, the OnePlus
# DTS, the SMB5 charger, the of/property device link); 0005-0025 are ours.
# Measured 2026-11-11: v7.0.14 + this series boots on hotdogb
# (7.0.14-sm8150-00025-g4a6a090d6d8a from RAM, display, USB, ssh).
#
# KERNEL_URL/KERNEL_COMMIT are provenance and drift check: the shared tree
# must be at KERNEL_COMMIT. A phone may name a different tree in its
# device.conf (KERNEL_REF, KERNEL_URL, KERNEL_COMMIT, KERNEL_PATCHDIR); without
# KERNEL_REF the build falls back to cloning KERNEL_URL.
KERNEL_REF=refs/linux/7.0.0
KERNEL_URL=https://gitlab.nura.eco/soc/qualcomm-sm8150/linux.git
KERNEL_COMMIT=8e126dbc4044ef2cec3ebe5754ddb05faa554af6
KERNEL_REF=refs/linux/7.0.14
KERNEL_URL=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
KERNEL_COMMIT=458c6079fc1d41d564c37679c8ace02cd83ee817
KERNEL_PATCHDIR=kernel/patches
@@ -0,0 +1,413 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Wed, 11 Nov 2026 08:00:00 +0000
Subject: [PATCH 01/25] arm64: dts: qcom: sm8150, pm8150, pm8150b, pm8150l:
nodes from the SM8150 fork
Taken from the qualcomm-sm8150 fork (gitlab.nura.eco/soc/qualcomm-sm8150/
linux.git, 8e126dbc4), the difference of these four files against v7.0.
The OnePlus 7T (hotdogb) DTS builds on them.
---
arch/arm64/boot/dts/qcom/pm8150.dtsi | 22 +++-
arch/arm64/boot/dts/qcom/pm8150b.dtsi | 52 +++++++++
arch/arm64/boot/dts/qcom/pm8150l.dtsi | 6 +
arch/arm64/boot/dts/qcom/sm8150.dtsi | 156 ++++++++++++++++++++++++--
4 files changed, 226 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/pm8150.dtsi b/arch/arm64/boot/dts/qcom/pm8150.dtsi
index d2568686a..18dfe2a5d 100644
--- a/arch/arm64/boot/dts/qcom/pm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150.dtsi
@@ -104,6 +104,18 @@ channel@6 {
qcom,pre-scaling = <1 1>;
label = "die_temp";
};
+
+ channel@83 {
+ reg = <ADC5_VPH_PWR>;
+ qcom,pre-scaling = <1 3>;
+ label = "vph_pwr";
+ };
+
+ channel@85 {
+ reg = <ADC5_VCOIN>;
+ qcom,pre-scaling = <1 3>;
+ label = "vcoin";
+ };
};
pm8150_adc_tm: adc-tm@3500 {
@@ -116,13 +128,21 @@ pm8150_adc_tm: adc-tm@3500 {
status = "disabled";
};
- rtc@6000 {
+ pm8150_rtc: rtc@6000 {
compatible = "qcom,pm8941-rtc";
reg = <0x6000>, <0x6100>;
reg-names = "rtc", "alarm";
interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
};
+ pm8150_sdam_2: sdam@b100 {
+ compatible = "qcom,spmi-sdam";
+ reg = <0xb100>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ status = "disabled";
+ };
+
pm8150_gpios: gpio@c000 {
compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
reg = <0xc000>;
diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
index 3f7b0b6a1..4a6797bf8 100644
--- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
@@ -107,6 +107,26 @@ pm8150b_temp: temp-alarm@2400 {
#thermal-sensor-cells = <0>;
};
+ pm8150b_charger: charger@1000 {
+ compatible = "qcom,pm8150b-charger";
+ reg = <0x1000>;
+
+ interrupts = <0x2 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x13 0x7 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "usb-plugin",
+ "bat-ov",
+ "wdog-bark",
+ "usbin-icl-change";
+
+ io-channels = <&pm8150b_adc ADC5_USB_IN_I>,
+ <&pm8150b_adc ADC5_USB_IN_V_16>;
+ io-channel-names = "usbin_i", "usbin_v";
+
+ status = "disabled";
+ };
+
pm8150b_adc: adc@3100 {
compatible = "qcom,spmi-adc5";
reg = <0x3100>;
@@ -133,11 +153,35 @@ channel@6 {
label = "die_temp";
};
+ channel@7 {
+ reg = <ADC5_USB_IN_I>;
+ qcom,pre-scaling = <1 1>;
+ label = "usbin_i";
+ };
+
+ channel@8 {
+ reg = <ADC5_USB_IN_V_16>;
+ qcom,pre-scaling = <1 16>;
+ label = "usbin_v";
+ };\
+
channel@9 {
reg = <ADC5_CHG_TEMP>;
qcom,pre-scaling = <1 1>;
label = "chg_temp";
};
+
+ channel@83 {
+ reg = <ADC5_VPH_PWR>;
+ qcom,pre-scaling = <1 3>;
+ label = "vph_pwr";
+ };
+
+ channel@85 {
+ reg = <ADC5_VCOIN>;
+ qcom,pre-scaling = <1 3>;
+ label = "vcoin";
+ };
};
pm8150b_adc_tm: adc-tm@3500 {
@@ -150,6 +194,14 @@ pm8150b_adc_tm: adc-tm@3500 {
status = "disabled";
};
+ pm8150b_fg: fuel-gauge@4000 {
+ compatible = "qcom,pm8150b-fg";
+ reg = <0x4000>;
+ interrupts = <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "soc-delta";
+ status = "disabled";
+ };
+
pm8150b_gpios: gpio@c000 {
compatible = "qcom,pm8150b-gpio", "qcom,spmi-gpio";
reg = <0xc000>;
diff --git a/arch/arm64/boot/dts/qcom/pm8150l.dtsi b/arch/arm64/boot/dts/qcom/pm8150l.dtsi
index 3911d6d0d..a678f0058 100644
--- a/arch/arm64/boot/dts/qcom/pm8150l.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150l.dtsi
@@ -86,6 +86,12 @@ channel@6 {
qcom,pre-scaling = <1 1>;
label = "die_temp";
};
+
+ channel@83 {
+ reg = <ADC5_VPH_PWR>;
+ qcom,pre-scaling = <1 3>;
+ label = "vph_pwr";
+ };
};
pm8150l_adc_tm: adc-tm@3500 {
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 97ca5275d..079e2f0a6 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -9,7 +9,9 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/phy/phy-qcom-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
+#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sm8150.h>
#include <dt-bindings/clock/qcom,dsi-phy-28nm.h>
@@ -870,6 +872,17 @@ modem_smp2p_in: slave-kernel {
interrupt-controller;
#interrupt-cells = <2>;
};
+
+ ipa_smp2p_out: ipa-ap-to-modem {
+ qcom,entry-name = "ipa";
+ #qcom,smem-state-cells = <1>;
+ };
+
+ ipa_smp2p_in: ipa-modem-to-ap {
+ qcom,entry-name = "ipa";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
};
smp2p-slpi {
@@ -2072,9 +2085,7 @@ pcie1_phy: phy@1c0e000 {
ufs_mem_hc: ufshc@1d84000 {
compatible = "qcom,sm8150-ufshc", "qcom,ufshc",
"jedec,ufs-2.0";
- reg = <0 0x01d84000 0 0x2500>,
- <0 0x01d90000 0 0x8000>;
- reg-names = "std", "ice";
+ reg = <0 0x01d84000 0 0x2500>;
interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
phys = <&ufs_mem_phy>;
phy-names = "ufsphy";
@@ -2083,6 +2094,8 @@ ufs_mem_hc: ufshc@1d84000 {
resets = <&gcc GCC_UFS_PHY_BCR>;
reset-names = "rst";
+ power-domains = <&gcc UFS_PHY_GDSC>;
+
iommus = <&apps_smmu 0x300 0>;
clock-names =
@@ -2093,8 +2106,7 @@ ufs_mem_hc: ufshc@1d84000 {
"ref_clk",
"tx_lane0_sync_clk",
"rx_lane0_sync_clk",
- "rx_lane1_sync_clk",
- "ice_core_clk";
+ "rx_lane1_sync_clk";
clocks =
<&gcc GCC_UFS_PHY_AXI_CLK>,
<&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
@@ -2103,8 +2115,7 @@ ufs_mem_hc: ufshc@1d84000 {
<&rpmhcc RPMH_CXO_CLK>,
<&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
<&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
- <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>,
- <&gcc GCC_UFS_PHY_ICE_CORE_CLK>;
+ <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
freq-table-hz =
<37500000 300000000>,
<0 0>,
@@ -2113,8 +2124,8 @@ ufs_mem_hc: ufshc@1d84000 {
<0 0>,
<0 0>,
<0 0>,
- <0 0>,
- <0 300000000>;
+ <0 0>;
+ qcom,ice = <&ice>;
status = "disabled";
};
@@ -2140,6 +2151,13 @@ ufs_mem_phy: phy@1d87000 {
status = "disabled";
};
+ ice: crypto@1d90000 {
+ compatible = "qcom,sm8150-inline-crypto-engine",
+ "qcom,inline-crypto-engine";
+ reg = <0 0x01d90000 0 0x8000>;
+ clocks = <&gcc GCC_UFS_PHY_ICE_CORE_CLK>;
+ };
+
cryptobam: dma-controller@1dc4000 {
compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
reg = <0 0x01dc4000 0 0x24000>;
@@ -2170,6 +2188,45 @@ crypto: crypto@1dfa000 {
interconnect-names = "memory";
};
+ ipa: ipa@1e00000 {
+ compatible = "qcom,sm8150-ipa";
+
+ iommus = <&apps_smmu 0x520 0x0>,
+ <&apps_smmu 0x521 0x0>;
+ reg = <0 0x01e40000 0 0x7000>,
+ <0 0x01e47000 0 0x2800>,
+ <0 0x01e04000 0 0x28000>;
+ reg-names = "ipa-reg",
+ "ipa-shared",
+ "gsi";
+
+ interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
+ <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
+ <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+ <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "ipa",
+ "gsi",
+ "ipa-clock-query",
+ "ipa-setup-ready";
+
+ clocks = <&rpmhcc RPMH_IPA_CLK>;
+ clock-names = "core";
+
+ interconnects = <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI_CH0 0>,
+ <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_OCIMEM 0>,
+ <&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_IPA_CFG 0>;
+ interconnect-names = "memory",
+ "imem",
+ "config";
+
+ qcom,smem-states = <&ipa_smp2p_out 0>,
+ <&ipa_smp2p_out 1>;
+ qcom,smem-state-names = "ipa-clock-enabled-valid",
+ "ipa-clock-enabled";
+
+ status = "disabled";
+ };
+
tcsr_mutex: hwlock@1f40000 {
compatible = "qcom,tcsr-mutex";
reg = <0x0 0x01f40000 0x0 0x20000>;
@@ -3813,6 +3870,8 @@ mdss: display-subsystem@ae00000 {
iommus = <&apps_smmu 0x800 0x420>;
+ resets = <&gcc DISP_CC_MDSS_CORE_BCR>;
+
status = "disabled";
#address-cells = <2>;
@@ -4325,6 +4384,32 @@ apps_smmu: iommu@15000000 {
dma-coherent;
};
+ slimbam: dma-controller@17184000 {
+ compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
+ qcom,controlled-remotely;
+ reg = <0 0x17184000 0 0x2c000>;
+ num-channels = <31>;
+ interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+ #dma-cells = <1>;
+ qcom,ee = <1>;
+ qcom,num-ees = <2>;
+ iommus = <&apps_smmu 0x1b46 0x0>;
+ };
+
+ slim: slim-ngd@171c0000 {
+ compatible = "qcom,slim-ngd-v2.1.0";
+ reg = <0 0x171c0000 0 0x2c000>;
+ interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
+
+ dmas = <&slimbam 3>, <&slimbam 4>;
+ dma-names = "rx", "tx";
+
+ iommus = <&apps_smmu 0x1b46 0x0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
remoteproc_adsp: remoteproc@17300000 {
compatible = "qcom,sm8150-adsp-pas";
reg = <0x0 0x17300000 0x0 0x4040>;
@@ -4357,6 +4442,56 @@ glink-edge {
qcom,remote-pid = <2>;
mboxes = <&apss_shared 8>;
+ apr {
+ compatible = "qcom,apr-v2";
+ qcom,glink-channels = "apr_audio_svc";
+ qcom,domain = <APR_DOMAIN_ADSP>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ apr-service@3 {
+ reg = <APR_SVC_ADSP_CORE>;
+ compatible = "qcom,q6core";
+ };
+
+ q6afe: apr-service@4 {
+ compatible = "qcom,q6afe";
+ reg = <APR_SVC_AFE>;
+ q6afedai: dais {
+ compatible = "qcom,q6afe-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+
+ q6afecc: cc {
+ compatible = "qcom,q6afe-clocks";
+ #clock-cells = <2>;
+ };
+ };
+
+ q6asm: apr-service@7 {
+ compatible = "qcom,q6asm";
+ reg = <APR_SVC_ASM>;
+ q6asmdai: dais {
+ compatible = "qcom,q6asm-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ iommus = <&apps_smmu 0x1b21 0x0>;
+ };
+ };
+
+ q6adm: apr-service@8 {
+ compatible = "qcom,q6adm";
+ reg = <APR_SVC_ADM>;
+ q6routing: routing {
+ compatible = "qcom,q6adm-routing";
+ #sound-dai-cells = <0>;
+ };
+ };
+ };
+
fastrpc {
compatible = "qcom,fastrpc";
qcom,glink-channels = "fastrpcglink-apps-dsp";
@@ -4625,6 +4760,9 @@ wifi: wifi@18800000 {
};
};
+ sound: sound {
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
@@ -0,0 +1,653 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Wed, 11 Nov 2026 08:00:00 +0000
Subject: [PATCH 02/25] arm64: dts: qcom: sm8150-oneplus-common and
sm8150-oneplus-hotdogb from the SM8150 fork
Taken from the qualcomm-sm8150 fork (gitlab.nura.eco/soc/qualcomm-sm8150/
linux.git, 8e126dbc4), as they are there. Only the hotdogb DTB is added to
the Makefile; the fork's other devices are not carried.
---
arch/arm64/boot/dts/qcom/Makefile | 1 +
.../boot/dts/qcom/sm8150-oneplus-common.dtsi | 545 ++++++++++++++++++
.../boot/dts/qcom/sm8150-oneplus-hotdogb.dts | 65 +++
3 files changed, 611 insertions(+)
create mode 100644 arch/arm64/boot/dts/qcom/sm8150-oneplus-common.dtsi
create mode 100644 arch/arm64/boot/dts/qcom/sm8150-oneplus-hotdogb.dts
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index b05e8adc0..c29627c8a 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -305,6 +305,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm7325-nothing-spacewar.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-hdk.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-microsoft-surface-duo.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb
+dtb-$(CONFIG_ARCH_QCOM) += sm8150-oneplus-hotdogb.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-bahamut.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-griffin.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8250-hdk.dtb
diff --git a/arch/arm64/boot/dts/qcom/sm8150-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sm8150-oneplus-common.dtsi
new file mode 100644
index 000000000..993ac0c2b
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sm8150-oneplus-common.dtsi
@@ -0,0 +1,545 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021, Caleb Connolly <caleb@connolly.tech>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "sm8150.dtsi"
+#include "pm8150.dtsi"
+#include "pm8150b.dtsi"
+#include "pm8150l.dtsi"
+
+/delete-node/ &rmtfs_mem;
+
+/ {
+ compatible = "qcom,sm8150-mtp", "qcom,sm8150";
+
+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ };
+
+ /*
+ * Apparently RPMh does not provide support for PM8150 S4 because it
+ * is always-on; model it as a fixed regulator.
+ */
+ vreg_s4a_1p8: pm8150-s4 {
+ compatible = "regulator-fixed";
+ regulator-name = "vreg_s4a_1p8";
+
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-always-on;
+ regulator-boot-on;
+
+ vin-supply = <&vph_pwr>;
+ };
+
+ reserved-memory {
+ /* The rmtfs_mem needs to be guarded due to "XPU limitations"
+ * it is otherwise possible for an allocation adjacent to the
+ * rmtfs_mem region to trigger an XPU violation, causing a crash.
+ */
+ // rmtfs_lower_guard: memory@f2900000 {
+ // no-map;
+ // reg = <0 0xf2900000 0 0x1000>;
+ // };
+ /*
+ * The rmtfs memory region in downstream is 'dynamically allocated'
+ * but given the same address every time. Hard code it as this address is
+ * where the modem firmware expects it to be.
+ */
+ rmtfs_mem: memory@f2901000 {
+ compatible = "qcom,rmtfs-mem";
+ reg = <0x0 0xf2901000 0x0 0x200000>;
+ no-map;
+
+ qcom,client-id = <1>;
+ qcom,vmid = <15>;
+ };
+ // rmtfs_upper: memory@f2902000 {
+ // no-map;
+ // reg = <0 0xf2902000 0 0x1000>;
+ // };
+ };
+};
+
+&adsp_mem {
+ reg = <0x0 0x8be00000 0x0 0x1e00000>;
+};
+
+&mpss_mem {
+ reg = <0x0 0x8dc00000 0x0 0x9600000>;
+};
+
+&venus_mem {
+ reg = <0x0 0x97200000 0x0 0x500000>;
+};
+
+&slpi_mem {
+ reg = <0x0 0x97700000 0x0 0x1400000>;
+};
+
+&ipa_fw_mem {
+ reg = <0x0 0x98b00000 0x0 0x10000>;
+};
+
+&ipa_gsi_mem {
+ reg = <0x0 0x98b10000 0x0 0x5000>;
+};
+
+&gpu_mem {
+ reg = <0x0 0x98b15000 0x0 0x2000>;
+};
+
+&spss_mem {
+ reg = <0x0 0x98c00000 0x0 0x100000>;
+};
+
+&cdsp_mem {
+ reg = <0x0 0x98d00000 0x0 0x1400000>;
+};
+
+// Just like the OnePlus 6, the OnePlus 7 puts this in a weird spot
+// Again it's left up to the driver to allocate this, it always allocates
+// it here.
+&rmtfs_mem {
+ reg = <0x0 0xf2901000 0x0 0x200000>;
+};
+
+&gpu {
+ status = "disabled";
+};
+
+&apps_rsc {
+ pm8150-rpmh-regulators {
+ compatible = "qcom,pm8150-rpmh-regulators";
+ qcom,pmic-id = "a";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vph_pwr>;
+ vdd-s3-supply = <&vph_pwr>;
+ vdd-s4-supply = <&vph_pwr>;
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-s6-supply = <&vph_pwr>;
+ vdd-s7-supply = <&vph_pwr>;
+ vdd-s8-supply = <&vph_pwr>;
+ vdd-s9-supply = <&vph_pwr>;
+ vdd-s10-supply = <&vph_pwr>;
+
+ vdd-l1-l8-l11-supply = <&vreg_s6a_0p9>;
+ vdd-l2-l10-supply = <&vreg_bob>;
+ vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p9>;
+ vdd-l6-l9-supply = <&vreg_s8c_1p3>;
+ vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p0>;
+ vdd-l13-l16-l17-supply = <&vreg_bob>;
+
+ vreg_s5a_2p0: smps5 {
+ regulator-min-microvolt = <1904000>;
+ regulator-max-microvolt = <2040000>;
+ };
+
+ vreg_s6a_0p9: smps6 {
+ regulator-min-microvolt = <920000>;
+ regulator-max-microvolt = <1128000>;
+ };
+
+ vdda_wcss_pll:
+ vreg_l1a_0p75: ldo1 {
+ regulator-min-microvolt = <752000>;
+ regulator-max-microvolt = <752000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vdd_pdphy:
+ vdda_usb_hs_3p1:
+ vreg_l2a_3p1: ldo2 {
+ regulator-min-microvolt = <3072000>;
+ regulator-max-microvolt = <3072000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3a_0p8: ldo3 {
+ regulator-min-microvolt = <480000>;
+ regulator-max-microvolt = <932000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vdd_usb_hs_core:
+ vdda_csi_0_0p9:
+ vdda_csi_1_0p9:
+ vdda_csi_2_0p9:
+ vdda_csi_3_0p9:
+ vdda_dsi_0_0p9:
+ vdda_dsi_1_0p9:
+ vdda_dsi_0_pll_0p9:
+ vdda_dsi_1_pll_0p9:
+ vdda_pcie_1ln_core:
+ vdda_pcie_2ln_core:
+ vdda_pll_hv_cc_ebi01:
+ vdda_pll_hv_cc_ebi23:
+ vdda_qrefs_0p875_5:
+ vdda_sp_sensor:
+ vdda_ufs_2ln_core_1:
+ vdda_ufs_2ln_core_2:
+ vdda_usb_ss_dp_core_1:
+ vdda_usb_ss_dp_core_2:
+ vdda_qlink_lv:
+ vdda_qlink_lv_ck:
+ vreg_l5a_0p875: ldo5 {
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <880000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6a_1p2: ldo6 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7a_1p8: ldo7 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vddpx_10:
+ vreg_l9a_1p2: ldo9 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10a_2p5: ldo10 {
+ regulator-min-microvolt = <2504000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l11a_0p8: ldo11 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vdd_qfprom:
+ vdd_qfprom_sp:
+ vdda_apc_cs_1p8:
+ vdda_gfx_cs_1p8:
+ vdda_usb_hs_1p8:
+ vdda_qrefs_vref_1p8:
+ vddpx_10_a:
+ vreg_l12a_1p8: ldo12 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l13a_2p7: ldo13 {
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2704000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l14a_1p8: ldo14 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1880000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l15a_1p7: ldo15 {
+ regulator-min-microvolt = <1704000>;
+ regulator-max-microvolt = <1704000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l16a_2p7: ldo16 {
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l17a_3p0: ldo17 {
+ regulator-min-microvolt = <2856000>;
+ regulator-max-microvolt = <3008000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ pm8150l-rpmh-regulators {
+ compatible = "qcom,pm8150l-rpmh-regulators";
+ qcom,pmic-id = "c";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vph_pwr>;
+ vdd-s3-supply = <&vph_pwr>;
+ vdd-s4-supply = <&vph_pwr>;
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-s6-supply = <&vph_pwr>;
+ vdd-s7-supply = <&vph_pwr>;
+ vdd-s8-supply = <&vph_pwr>;
+
+ vdd-l1-l8-supply = <&vreg_s4a_1p8>;
+ vdd-l2-l3-supply = <&vreg_s8c_1p3>;
+ vdd-l4-l5-l6-supply = <&vreg_bob>;
+ vdd-l7-l11-supply = <&vreg_bob>;
+ vdd-l9-l10-supply = <&vreg_bob>;
+
+ vdd-bob-supply = <&vph_pwr>;
+ vdd-flash-supply = <&vreg_bob>;
+ vdd-rgb-supply = <&vreg_bob>;
+
+ vreg_bob: bob {
+ regulator-min-microvolt = <3008000>;
+ regulator-max-microvolt = <4000000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+ regulator-allow-bypass;
+ };
+
+ vreg_s8c_1p3: smps8 {
+ regulator-min-microvolt = <1352000>;
+ regulator-max-microvolt = <1352000>;
+ };
+
+ vreg_l1c_1p8: ldo1 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vdda_wcss_adcdac_1:
+ vdda_wcss_adcdac_22:
+ vreg_l2c_1p3: ldo2 {
+ regulator-min-microvolt = <1304000>;
+ regulator-max-microvolt = <1304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vdda_hv_ebi0:
+ vdda_hv_ebi1:
+ vdda_hv_ebi2:
+ vdda_hv_ebi3:
+ vdda_hv_refgen0:
+ vdda_qlink_hv_ck:
+ vreg_l3c_1p2: ldo3 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vddpx_5:
+ vreg_l4c_1p8: ldo4 {
+ regulator-min-microvolt = <1704000>;
+ regulator-max-microvolt = <2928000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vddpx_6:
+ vreg_l5c_1p8: ldo5 {
+ regulator-min-microvolt = <1704000>;
+ regulator-max-microvolt = <2928000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vddpx_2:
+ vreg_l6c_2p9: ldo6 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7c_3p0: ldo7 {
+ regulator-min-microvolt = <2856000>;
+ regulator-max-microvolt = <3104000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l8c_1p8: ldo8 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l9c_2p9: ldo9 {
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10c_3p3: ldo10 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3312000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l11c_3p3: ldo11 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3312000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ pm8009-rpmh-regulators {
+ compatible = "qcom,pm8009-rpmh-regulators";
+ qcom,pmic-id = "f";
+
+ vdd-s1-supply = <&vph_pwr>;
+ vdd-s2-supply = <&vreg_bob>;
+
+ vdd-l2-supply = <&vreg_s8c_1p3>;
+ vdd-l5-l6-supply = <&vreg_bob>;
+
+ vreg_l2f_1p2: ldo2 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5f_2p85: ldo5 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6f_2p85: ldo6 {
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-min-microvolt = <2856000>;
+ regulator-max-microvolt = <2856000>;
+ };
+ };
+};
+
+&qupv3_id_1 {
+ status = "okay";
+};
+
+&pon {
+ pwrkey {
+ status = "okay";
+ };
+
+ resin {
+ compatible = "qcom,pm8941-resin";
+ interrupts = <0x0 0x8 0x1 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+ linux,code = <KEY_VOLUMEDOWN>;
+ };
+};
+
+&remoteproc_adsp {
+ status = "disabled";
+};
+
+&remoteproc_cdsp {
+ status = "disabled";
+};
+
+&remoteproc_slpi {
+ status = "disabled";
+};
+
+&remoteproc_mpss {
+ status = "okay";
+ firmware-name = "qcom/sm8150/oneplus7/modem.mdt";
+};
+
+// Some of these might be guacamole specific
+&tlmm {
+ gpio-reserved-ranges = <0 4>, <126 4>;
+
+ tp_irq_active: tp-irq-active {
+ mux {
+ pins = "gpio122";
+ function = "gpio";
+ };
+
+ config {
+ pins = "gpio122";
+ drive-strength = <0x08>;
+ bias-disable;
+ input-enable;
+ };
+ };
+
+ tp_rst_active: tp-rst-active {
+ mux {
+ pins = "gpio54";
+ function = "gpio";
+ };
+
+ config {
+ pins = "gpio54";
+ drive-strength = <0x08>;
+ bias-disable;
+ };
+ };
+
+ tp_1v8_active: tp-1v8-active {
+ mux {
+ pins = "gpio119";
+ function = "gpio";
+ };
+
+ config {
+ pins = "gpio119";
+ drive-strength = <0x08>;
+ bias-pull-up;
+ };
+ };
+};
+
+&ufs_mem_hc {
+ status = "okay";
+
+ reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
+
+ vcc-supply = <&vreg_l10a_2p5>;
+ vcc-max-microamp = <750000>;
+ vccq-supply = <&vreg_l9a_1p2>;
+ vccq-max-microamp = <700000>;
+ vccq2-supply = <&vreg_s4a_1p8>;
+ vccq2-max-microamp = <750000>;
+};
+
+&ufs_mem_phy {
+ status = "okay";
+
+ vdda-phy-supply = <&vdda_ufs_2ln_core_1>;
+ vdda-max-microamp = <90200>;
+ vdda-pll-supply = <&vreg_l3c_1p2>;
+ vdda-pll-max-microamp = <19000>;
+};
+
+&usb_1_hsphy {
+ status = "okay";
+ vdda-pll-supply = <&vdd_usb_hs_core>;
+ vdda33-supply = <&vdda_usb_hs_3p1>;
+ vdda18-supply = <&vdda_usb_hs_1p8>;
+};
+
+&usb_1_qmpphy {
+ status = "okay";
+ vdda-phy-supply = <&vreg_l3c_1p2>;
+ vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
+};
+
+&usb_1 {
+ status = "okay";
+};
+
+&usb_1_dwc3 {
+ dr_mode = "peripheral";
+};
+
+&wifi {
+ status = "okay";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/sm8150-oneplus-hotdogb.dts b/arch/arm64/boot/dts/qcom/sm8150-oneplus-hotdogb.dts
new file mode 100644
index 000000000..7ba966a83
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sm8150-oneplus-hotdogb.dts
@@ -0,0 +1,65 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "sm8150-oneplus-common.dtsi"
+
+/ {
+ model = "OnePlus 7T";
+ compatible = "oneplus,hotdobg", "oneplus,oneplus7", "qcom,sm8150";
+
+ aliases {
+ display0 = &framebuffer0;
+ };
+
+ chosen {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ stdout-path = "display0";
+
+ /*
+ * hack: Use framebuffer setup by the bootloader for simplefb.
+ * the address is taken from the bootloader config (strings xbl.img | grep "Display Reserved")
+ */
+ framebuffer0: framebuffer@9C000000 {
+ compatible = "simple-framebuffer";
+ reg = <0 0x9C000000 0 (1080 * 2400 * 4)>;
+ width = <1080>;
+ height = <2400>;
+ stride = <(1080 * 4)>;
+ format = "a8r8g8b8";
+ status = "okay";
+
+ };
+ };
+
+ reserved-memory {
+ // hack: Bootloader framebuffer memory region
+ fb_mem: memory@a1a10000 {
+ compatible = "removed-dma-pool";
+ no-map;
+ reg = <0 0x9C000000 0 (1080 * 2400 * 4)>;
+ };
+
+ removed_region: removed-region@89d00000 {
+ reg = <0x0 0x89d00000 0x0 0x1a00000>;
+ no-map;
+ };
+ ramoops: ramoops@0xA9800000 {
+ compatible = "ramoops";
+ reg = <0 0xA9800000 0 0x400000>;
+ record-size = <0x40000>;
+ console-size = <0x40000>;
+ ftrace-size = <0x40000>;
+ pmsg-size = <0x200000>;
+ devinfo-size = <0x1000>;
+ ecc-size = <0x0>;
+ };
+ };
+};
\ No newline at end of file
@@ -0,0 +1,945 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Wed, 11 Nov 2026 08:00:00 +0000
Subject: [PATCH 03/25] power: supply: qcom_smbx: SMB5 (pm8150b, pm7250b), the
fork's driver
The file as it is in the qualcomm-sm8150 fork (gitlab.nura.eco/soc/
qualcomm-sm8150/linux.git, 8e126dbc4): the driver split into SMB2 and SMB5
generations, with the pm8150b charger that the OnePlus 7T uses. v7.0.14
has the same qcom_smbx.c as v7.0, so this is the fork's change unaltered.
Mainline reworked the SMB2 path after 7.0 (health as bits, the watchdog
pet address, charging enabled after CHGR_CFG2, the float voltage from
constant-charge-voltage-max); on a later base those fixes have to be
carried over per generation.
---
.../power/supply/qcom,pmi8998-charger.yaml | 2 +
drivers/power/supply/qcom_smbx.c | 605 ++++++++++--------
2 files changed, 344 insertions(+), 263 deletions(-)
diff --git a/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
index 70f5cd6ea..9e200ba3f 100644
--- a/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
@@ -12,6 +12,8 @@ maintainers:
properties:
compatible:
enum:
+ - qcom,pm7250b-charger
+ - qcom,pm8150b-charger
- qcom,pmi8998-charger
- qcom,pm660-charger
diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
index b1cb92558..2b5d20bac 100644
--- a/drivers/power/supply/qcom_smbx.c
+++ b/drivers/power/supply/qcom_smbx.c
@@ -23,38 +23,30 @@
#include <linux/types.h>
#include <linux/workqueue.h>
+enum smb_generation {
+ SMB2,
+ SMB5,
+};
+
+#define SMB_REG_OFFSET(smb) (smb->gen == SMB2 ? 0x600 : 0x100)
+
/* clang-format off */
#define BATTERY_CHARGER_STATUS_1 0x06
-#define BVR_INITIAL_RAMP_BIT BIT(7)
-#define CC_SOFT_TERMINATE_BIT BIT(6)
-#define STEP_CHARGING_STATUS_SHIFT 3
-#define STEP_CHARGING_STATUS_MASK GENMASK(5, 3)
#define BATTERY_CHARGER_STATUS_MASK GENMASK(2, 0)
#define BATTERY_CHARGER_STATUS_2 0x07
-#define INPUT_CURRENT_LIMITED_BIT BIT(7)
-#define CHARGER_ERROR_STATUS_SFT_EXPIRE_BIT BIT(6)
-#define CHARGER_ERROR_STATUS_BAT_OV_BIT BIT(5)
-#define CHARGER_ERROR_STATUS_BAT_TERM_MISSING_BIT BIT(4)
-#define BAT_TEMP_STATUS_MASK GENMASK(3, 0)
-#define BAT_TEMP_STATUS_SOFT_LIMIT_MASK GENMASK(3, 2)
-#define BAT_TEMP_STATUS_HOT_SOFT_LIMIT_BIT BIT(3)
-#define BAT_TEMP_STATUS_COLD_SOFT_LIMIT_BIT BIT(2)
-#define BAT_TEMP_STATUS_TOO_HOT_BIT BIT(1)
-#define BAT_TEMP_STATUS_TOO_COLD_BIT BIT(0)
-
-#define BATTERY_CHARGER_STATUS_4 0x0A
-#define CHARGE_CURRENT_POST_JEITA_MASK GENMASK(7, 0)
+#define SMB2_CHARGER_ERROR_STATUS_BAT_OV_BIT BIT(5)
+#define SMB2_BAT_TEMP_STATUS_HOT_SOFT_LIMIT_BIT BIT(3)
+#define SMB2_BAT_TEMP_STATUS_COLD_SOFT_LIMIT_BIT BIT(2)
+#define SMB2_BAT_TEMP_STATUS_TOO_HOT_BIT BIT(1)
+#define SMB5_CHARGER_ERROR_STATUS_BAT_OV_BIT BIT(1)
+#define SMB2_BAT_TEMP_STATUS_TOO_COLD_BIT BIT(0)
#define BATTERY_CHARGER_STATUS_7 0x0D
-#define ENABLE_TRICKLE_BIT BIT(7)
-#define ENABLE_PRE_CHARGING_BIT BIT(6)
-#define ENABLE_FAST_CHARGING_BIT BIT(5)
-#define ENABLE_FULLON_MODE_BIT BIT(4)
-#define TOO_COLD_ADC_BIT BIT(3)
-#define TOO_HOT_ADC_BIT BIT(2)
-#define HOT_SL_ADC_BIT BIT(1)
-#define COLD_SL_ADC_BIT BIT(0)
+#define SMB5_BAT_TEMP_STATUS_HOT_SOFT_BIT BIT(5)
+#define SMB5_BAT_TEMP_STATUS_COLD_SOFT_BIT BIT(4)
+#define SMB5_BAT_TEMP_STATUS_TOO_HOT_BIT BIT(3)
+#define SMB5_BAT_TEMP_STATUS_TOO_COLD_BIT BIT(2)
#define CHARGING_ENABLE_CMD 0x42
#define CHARGING_ENABLE_CMD_BIT BIT(0)
@@ -78,269 +70,127 @@
#define FLOAT_VOLTAGE_CFG 0x70
#define FLOAT_VOLTAGE_SETTING_MASK GENMASK(7, 0)
-#define FG_UPDATE_CFG_2_SEL 0x7D
-#define SOC_LT_OTG_THRESH_SEL_BIT BIT(3)
-#define SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(2)
-#define VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(1)
-#define IBT_LT_CHG_TERM_THRESH_SEL_BIT BIT(0)
-
-#define JEITA_EN_CFG 0x90
-#define JEITA_EN_HARDLIMIT_BIT BIT(4)
-#define JEITA_EN_HOT_SL_FCV_BIT BIT(3)
-#define JEITA_EN_COLD_SL_FCV_BIT BIT(2)
-#define JEITA_EN_HOT_SL_CCC_BIT BIT(1)
-#define JEITA_EN_COLD_SL_CCC_BIT BIT(0)
-
-#define INT_RT_STS 0x310
-#define TYPE_C_CHANGE_RT_STS_BIT BIT(7)
-#define USBIN_ICL_CHANGE_RT_STS_BIT BIT(6)
-#define USBIN_SOURCE_CHANGE_RT_STS_BIT BIT(5)
-#define USBIN_PLUGIN_RT_STS_BIT BIT(4)
-#define USBIN_OV_RT_STS_BIT BIT(3)
-#define USBIN_UV_RT_STS_BIT BIT(2)
-#define USBIN_LT_3P6V_RT_STS_BIT BIT(1)
-#define USBIN_COLLAPSE_RT_STS_BIT BIT(0)
+#define SMB2_FG_UPDATE_CFG_2_SEL 0x7D
+#define SMB2_SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(2)
+#define SMB2_VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(1)
+
+#define SMB5_CHARGE_RCHG_SOC_THRESHOLD_CFG_REG 0x7D
+#define SMB5_CHARGE_RCHG_SOC_THRESHOLD_CFG_MASK GENMASK(7, 0)
#define OTG_CFG 0x153
-#define OTG_RESERVED_MASK GENMASK(7, 6)
-#define DIS_OTG_ON_TLIM_BIT BIT(5)
-#define QUICKSTART_OTG_FASTROLESWAP_BIT BIT(4)
-#define INCREASE_DFP_TIME_BIT BIT(3)
-#define ENABLE_OTG_IN_DEBUG_MODE_BIT BIT(2)
#define OTG_EN_SRC_CFG_BIT BIT(1)
-#define CONCURRENT_MODE_CFG_BIT BIT(0)
-
-#define OTG_ENG_OTG_CFG 0x1C0
-#define ENG_BUCKBOOST_HALT1_8_MODE_BIT BIT(0)
#define APSD_STATUS 0x307
-#define APSD_STATUS_7_BIT BIT(7)
-#define HVDCP_CHECK_TIMEOUT_BIT BIT(6)
-#define SLOW_PLUGIN_TIMEOUT_BIT BIT(5)
-#define ENUMERATION_DONE_BIT BIT(4)
-#define VADP_CHANGE_DONE_AFTER_AUTH_BIT BIT(3)
-#define QC_AUTH_DONE_STATUS_BIT BIT(2)
-#define QC_CHARGER_BIT BIT(1)
#define APSD_DTC_STATUS_DONE_BIT BIT(0)
#define APSD_RESULT_STATUS 0x308
-#define ICL_OVERRIDE_LATCH_BIT BIT(7)
#define APSD_RESULT_STATUS_MASK GENMASK(6, 0)
-#define QC_3P0_BIT BIT(6)
-#define QC_2P0_BIT BIT(5)
#define FLOAT_CHARGER_BIT BIT(4)
#define DCP_CHARGER_BIT BIT(3)
#define CDP_CHARGER_BIT BIT(2)
#define OCP_CHARGER_BIT BIT(1)
#define SDP_CHARGER_BIT BIT(0)
-#define TYPE_C_STATUS_1 0x30B
-#define UFP_TYPEC_MASK GENMASK(7, 5)
-#define UFP_TYPEC_RDSTD_BIT BIT(7)
-#define UFP_TYPEC_RD1P5_BIT BIT(6)
-#define UFP_TYPEC_RD3P0_BIT BIT(5)
-#define UFP_TYPEC_FMB_255K_BIT BIT(4)
-#define UFP_TYPEC_FMB_301K_BIT BIT(3)
-#define UFP_TYPEC_FMB_523K_BIT BIT(2)
-#define UFP_TYPEC_FMB_619K_BIT BIT(1)
-#define UFP_TYPEC_OPEN_OPEN_BIT BIT(0)
-
-#define TYPE_C_STATUS_2 0x30C
-#define DFP_RA_OPEN_BIT BIT(7)
-#define TIMER_STAGE_BIT BIT(6)
-#define EXIT_UFP_MODE_BIT BIT(5)
-#define EXIT_DFP_MODE_BIT BIT(4)
-#define DFP_TYPEC_MASK GENMASK(3, 0)
-#define DFP_RD_OPEN_BIT BIT(3)
-#define DFP_RD_RA_VCONN_BIT BIT(2)
-#define DFP_RD_RD_BIT BIT(1)
-#define DFP_RA_RA_BIT BIT(0)
-
-#define TYPE_C_STATUS_3 0x30D
-#define ENABLE_BANDGAP_BIT BIT(7)
-#define U_USB_GND_NOVBUS_BIT BIT(6)
-#define U_USB_FLOAT_NOVBUS_BIT BIT(5)
-#define U_USB_GND_BIT BIT(4)
-#define U_USB_FMB1_BIT BIT(3)
-#define U_USB_FLOAT1_BIT BIT(2)
-#define U_USB_FMB2_BIT BIT(1)
-#define U_USB_FLOAT2_BIT BIT(0)
-
-#define TYPE_C_STATUS_4 0x30E
-#define UFP_DFP_MODE_STATUS_BIT BIT(7)
-#define TYPEC_VBUS_STATUS_BIT BIT(6)
-#define TYPEC_VBUS_ERROR_STATUS_BIT BIT(5)
-#define TYPEC_DEBOUNCE_DONE_STATUS_BIT BIT(4)
-#define TYPEC_UFP_AUDIO_ADAPT_STATUS_BIT BIT(3)
-#define TYPEC_VCONN_OVERCURR_STATUS_BIT BIT(2)
-#define CC_ORIENTATION_BIT BIT(1)
-#define CC_ATTACHED_BIT BIT(0)
-
-#define TYPE_C_STATUS_5 0x30F
-#define TRY_SOURCE_FAILED_BIT BIT(6)
-#define TRY_SINK_FAILED_BIT BIT(5)
-#define TIMER_STAGE_2_BIT BIT(4)
-#define TYPEC_LEGACY_CABLE_STATUS_BIT BIT(3)
-#define TYPEC_NONCOMP_LEGACY_CABLE_STATUS_BIT BIT(2)
-#define TYPEC_TRYSOURCE_DETECT_STATUS_BIT BIT(1)
-#define TYPEC_TRYSINK_DETECT_STATUS_BIT BIT(0)
+#define USBIN_CMD_IL 0x340
+#define USBIN_SUSPEND_BIT BIT(0)
#define CMD_APSD 0x341
-#define ICL_OVERRIDE_BIT BIT(1)
#define APSD_RERUN_BIT BIT(0)
+#define CMD_ICL_OVERRIDE 0x342
+#define ICL_OVERRIDE_BIT BIT(0)
+
#define TYPE_C_CFG 0x358
#define APSD_START_ON_CC_BIT BIT(7)
-#define WAIT_FOR_APSD_BIT BIT(6)
#define FACTORY_MODE_DETECTION_EN_BIT BIT(5)
-#define FACTORY_MODE_ICL_3A_4A_BIT BIT(4)
-#define FACTORY_MODE_DIS_CHGING_CFG_BIT BIT(3)
-#define SUSPEND_NON_COMPLIANT_CFG_BIT BIT(2)
#define VCONN_OC_CFG_BIT BIT(1)
-#define TYPE_C_OR_U_USB_BIT BIT(0)
-
-#define TYPE_C_CFG_2 0x359
-#define TYPE_C_DFP_CURRSRC_MODE_BIT BIT(7)
-#define DFP_CC_1P4V_OR_1P6V_BIT BIT(6)
-#define VCONN_SOFTSTART_CFG_MASK GENMASK(5, 4)
-#define EN_TRY_SOURCE_MODE_BIT BIT(3)
-#define USB_FACTORY_MODE_ENABLE_BIT BIT(2)
-#define TYPE_C_UFP_MODE_BIT BIT(1)
-#define EN_80UA_180UA_CUR_SOURCE_BIT BIT(0)
-
-#define TYPE_C_CFG_3 0x35A
-#define TVBUS_DEBOUNCE_BIT BIT(7)
-#define TYPEC_LEGACY_CABLE_INT_EN_BIT BIT(6)
-#define TYPEC_NONCOMPLIANT_LEGACY_CABLE_INT_EN_B BIT(5)
-#define TYPEC_TRYSOURCE_DETECT_INT_EN_BIT BIT(4)
-#define TYPEC_TRYSINK_DETECT_INT_EN_BIT BIT(3)
-#define EN_TRYSINK_MODE_BIT BIT(2)
-#define EN_LEGACY_CABLE_DETECTION_BIT BIT(1)
-#define ALLOW_PD_DRING_UFP_TCCDB_BIT BIT(0)
#define USBIN_OPTIONS_1_CFG 0x362
-#define CABLE_R_SEL_BIT BIT(7)
-#define HVDCP_AUTH_ALG_EN_CFG_BIT BIT(6)
-#define HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT BIT(5)
-#define INPUT_PRIORITY_BIT BIT(4)
#define AUTO_SRC_DETECT_BIT BIT(3)
#define HVDCP_EN_BIT BIT(2)
-#define VADP_INCREMENT_VOLTAGE_LIMIT_BIT BIT(1)
-#define VADP_TAPER_TIMER_EN_BIT BIT(0)
-
-#define USBIN_OPTIONS_2_CFG 0x363
-#define WIPWR_RST_EUD_CFG_BIT BIT(7)
-#define SWITCHER_START_CFG_BIT BIT(6)
-#define DCD_TIMEOUT_SEL_BIT BIT(5)
-#define OCD_CURRENT_SEL_BIT BIT(4)
-#define SLOW_PLUGIN_TIMER_EN_CFG_BIT BIT(3)
-#define FLOAT_OPTIONS_MASK GENMASK(2, 0)
-#define FLOAT_DIS_CHGING_CFG_BIT BIT(2)
-#define SUSPEND_FLOAT_CFG_BIT BIT(1)
-#define FORCE_FLOAT_SDP_CFG_BIT BIT(0)
-
-#define TAPER_TIMER_SEL_CFG 0x364
-#define TYPEC_SPARE_CFG_BIT BIT(7)
-#define TYPEC_DRP_DFP_TIME_CFG_BIT BIT(5)
-#define TAPER_TIMER_SEL_MASK GENMASK(1, 0)
-
-#define USBIN_LOAD_CFG 0x365
-#define USBIN_OV_CH_LOAD_OPTION_BIT BIT(7)
+
+#define USBIN_LOAD_CFG 0x65
#define ICL_OVERRIDE_AFTER_APSD_BIT BIT(4)
#define USBIN_ICL_OPTIONS 0x366
-#define CFG_USB3P0_SEL_BIT BIT(2)
#define USB51_MODE_BIT BIT(1)
#define USBIN_MODE_CHG_BIT BIT(0)
+/* PMI8998 only */
#define TYPE_C_INTRPT_ENB_SOFTWARE_CTRL 0x368
-#define EXIT_SNK_BASED_ON_CC_BIT BIT(7)
-#define VCONN_EN_ORIENTATION_BIT BIT(6)
-#define TYPEC_VCONN_OVERCURR_INT_EN_BIT BIT(5)
-#define VCONN_EN_SRC_BIT BIT(4)
+#define SMB2_VCONN_EN_SRC_BIT BIT(4)
#define VCONN_EN_VALUE_BIT BIT(3)
#define TYPEC_POWER_ROLE_CMD_MASK GENMASK(2, 0)
-#define UFP_EN_CMD_BIT BIT(2)
-#define DFP_EN_CMD_BIT BIT(1)
-#define TYPEC_DISABLE_CMD_BIT BIT(0)
+#define SMB5_EN_SNK_ONLY_BIT BIT(1)
#define USBIN_CURRENT_LIMIT_CFG 0x370
-#define USBIN_CURRENT_LIMIT_MASK GENMASK(7, 0)
#define USBIN_AICL_OPTIONS_CFG 0x380
#define SUSPEND_ON_COLLAPSE_USBIN_BIT BIT(7)
-#define USBIN_AICL_HDC_EN_BIT BIT(6)
#define USBIN_AICL_START_AT_MAX_BIT BIT(5)
-#define USBIN_AICL_RERUN_EN_BIT BIT(4)
+#define USBIN_AICL_PERIODIC_RERUN_EN_BIT BIT(4)
#define USBIN_AICL_ADC_EN_BIT BIT(3)
#define USBIN_AICL_EN_BIT BIT(2)
#define USBIN_HV_COLLAPSE_RESPONSE_BIT BIT(1)
#define USBIN_LV_COLLAPSE_RESPONSE_BIT BIT(0)
+// FIXME: drop these and their programming, no need to set min to 4.3v
#define USBIN_5V_AICL_THRESHOLD_CFG 0x381
#define USBIN_5V_AICL_THRESHOLD_CFG_MASK GENMASK(2, 0)
#define USBIN_CONT_AICL_THRESHOLD_CFG 0x384
#define USBIN_CONT_AICL_THRESHOLD_CFG_MASK GENMASK(5, 0)
-#define DC_ENG_SSUPPLY_CFG2 0x4C1
-#define ENG_SSUPPLY_IVREF_OTG_SS_MASK GENMASK(2, 0)
-#define OTG_SS_SLOW 0x3
-
-#define DCIN_AICL_REF_SEL_CFG 0x481
-#define DCIN_CONT_AICL_THRESHOLD_CFG_MASK GENMASK(5, 0)
-
-#define WI_PWR_OPTIONS 0x495
-#define CHG_OK_BIT BIT(7)
-#define WIPWR_UVLO_IRQ_OPT_BIT BIT(6)
-#define BUCK_HOLDOFF_ENABLE_BIT BIT(5)
-#define CHG_OK_HW_SW_SELECT_BIT BIT(4)
-#define WIPWR_RST_ENABLE_BIT BIT(3)
-#define DCIN_WIPWR_IRQ_SELECT_BIT BIT(2)
-#define AICL_SWITCH_ENABLE_BIT BIT(1)
-#define ZIN_ICL_ENABLE_BIT BIT(0)
-
-#define ICL_STATUS 0x607
+#define ICL_STATUS(smb) (SMB_REG_OFFSET(smb) + 0x07)
#define INPUT_CURRENT_LIMIT_MASK GENMASK(7, 0)
-#define POWER_PATH_STATUS 0x60B
-#define P_PATH_INPUT_SS_DONE_BIT BIT(7)
-#define P_PATH_USBIN_SUSPEND_STS_BIT BIT(6)
-#define P_PATH_DCIN_SUSPEND_STS_BIT BIT(5)
+#define POWER_PATH_STATUS(smb) (SMB_REG_OFFSET(smb) + 0x0B)
#define P_PATH_USE_USBIN_BIT BIT(4)
-#define P_PATH_USE_DCIN_BIT BIT(3)
-#define P_PATH_POWER_PATH_MASK GENMASK(2, 1)
#define P_PATH_VALID_INPUT_POWER_SOURCE_STS_BIT BIT(0)
+/* 0x5xx region is PM8150b only Type-C registers */
+
+/* Bits 2:0 match PMI8998 TYPE_C_INTRPT_ENB_SOFTWARE_CTRL */
+#define SMB5_TYPE_C_MODE_CFG 0x544
+#define SMB5_EN_TRY_SNK_BIT BIT(4)
+#define SMB5_EN_SNK_ONLY_BIT BIT(1)
+
+#define SMB5_TYPEC_TYPE_C_VCONN_CONTROL 0x546
+#define SMB5_VCONN_EN_ORIENTATION_BIT BIT(2)
+#define SMB5_VCONN_EN_VALUE_BIT BIT(1)
+#define SMB5_VCONN_EN_SRC_BIT BIT(0)
+
+
+#define SMB5_TYPE_C_DEBUG_ACCESS_SINK 0x54a
+#define SMB5_TYPEC_DEBUG_ACCESS_SINK_MASK GENMASK(4, 0)
+
+#define SMB5_DEBUG_ACCESS_SRC_CFG 0x54C
+#define SMB5_EN_UNORIENTED_DEBUG_ACCESS_SRC_BIT BIT(0)
+
+#define SMB5_TYPE_C_EXIT_STATE_CFG 0x550
+#define SMB5_BYPASS_VSAFE0V_DURING_ROLE_SWAP_BIT BIT(3)
+#define SMB5_SEL_SRC_UPPER_REF_BIT BIT(2)
+#define SMB5_EXIT_SNK_BASED_ON_CC_BIT BIT(0)
+
+/* Common */
+
#define BARK_BITE_WDOG_PET 0x643
#define BARK_BITE_WDOG_PET_BIT BIT(0)
#define WD_CFG 0x651
#define WATCHDOG_TRIGGER_AFP_EN_BIT BIT(7)
#define BARK_WDOG_INT_EN_BIT BIT(6)
-#define BITE_WDOG_INT_EN_BIT BIT(5)
-#define SFT_AFTER_WDOG_IRQ_MASK GENMASK(4, 3)
-#define WDOG_IRQ_SFT_BIT BIT(2)
#define WDOG_TIMER_EN_ON_PLUGIN_BIT BIT(1)
-#define WDOG_TIMER_EN_BIT BIT(0)
#define SNARL_BARK_BITE_WD_CFG 0x653
-#define BITE_WDOG_DISABLE_CHARGING_CFG_BIT BIT(7)
-#define SNARL_WDOG_TIMEOUT_MASK GENMASK(6, 4)
-#define BARK_WDOG_TIMEOUT_MASK GENMASK(3, 2)
-#define BITE_WDOG_TIMEOUT_MASK GENMASK(1, 0)
#define AICL_RERUN_TIME_CFG 0x661
#define AICL_RERUN_TIME_MASK GENMASK(1, 0)
+#define AIC_RERUN_TIME_3_SECS 0x0
+/* FIXME: probably remove this so we get parallel charging? */
#define STAT_CFG 0x690
-#define STAT_SW_OVERRIDE_VALUE_BIT BIT(7)
#define STAT_SW_OVERRIDE_CFG_BIT BIT(6)
-#define STAT_PARALLEL_OFF_DG_CFG_MASK GENMASK(5, 4)
-#define STAT_POLARITY_CFG_BIT BIT(3)
-#define STAT_PARALLEL_CFG_BIT BIT(2)
-#define STAT_FUNCTION_CFG_BIT BIT(1)
-#define STAT_IRQ_PULSING_EN_BIT BIT(0)
#define SDP_CURRENT_UA 500000
#define CDP_CURRENT_UA 1500000
@@ -388,6 +238,7 @@ struct smb_chip {
unsigned int base;
struct regmap *regmap;
struct power_supply_battery_info *batt_info;
+ enum smb_generation gen;
struct delayed_work status_change_work;
int cable_irq;
@@ -399,6 +250,13 @@ struct smb_chip {
struct power_supply *chg_psy;
};
+struct smb_match_data {
+ const char *name;
+ enum smb_generation gen;
+ size_t init_seq_len;
+ const struct smb_init_register *init_seq;
+};
+
static enum power_supply_property smb_properties[] = {
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_MODEL_NAME,
@@ -416,7 +274,7 @@ static int smb_get_prop_usb_online(struct smb_chip *chip, int *val)
unsigned int stat;
int rc;
- rc = regmap_read(chip->regmap, chip->base + POWER_PATH_STATUS, &stat);
+ rc = regmap_read(chip->regmap, chip->base + POWER_PATH_STATUS(chip), &stat);
if (rc < 0) {
dev_err(chip->dev, "Couldn't read power path status: %d\n", rc);
return rc;
@@ -471,9 +329,35 @@ static int smb_apsd_get_charger_type(struct smb_chip *chip, int *val)
return 0;
}
+/* Return 1 when in overvoltage state, else 0 or -errno */
+static int smbx_ov_status(struct smb_chip *chip)
+{
+ u16 reg;
+ u8 mask;
+ int rc;
+ u32 val;
+
+ switch (chip->gen) {
+ case SMB2:
+ reg = BATTERY_CHARGER_STATUS_2;
+ mask = SMB2_CHARGER_ERROR_STATUS_BAT_OV_BIT;
+ break;
+ case SMB5:
+ reg = BATTERY_CHARGER_STATUS_7;
+ mask = SMB5_CHARGER_ERROR_STATUS_BAT_OV_BIT;
+ break;
+ }
+
+ rc = regmap_read(chip->regmap, chip->base + reg, &val);
+ if (rc)
+ return rc;
+
+ return !!(reg & mask);
+}
+
static int smb_get_prop_status(struct smb_chip *chip, int *val)
{
- unsigned char stat[2];
+ u32 stat;
int usb_online = 0;
int rc;
@@ -483,22 +367,27 @@ static int smb_get_prop_status(struct smb_chip *chip, int *val)
return rc;
}
- rc = regmap_bulk_read(chip->regmap,
- chip->base + BATTERY_CHARGER_STATUS_1, &stat, 2);
+ rc = regmap_read(chip->regmap,
+ chip->base + BATTERY_CHARGER_STATUS_1, &stat);
if (rc < 0) {
dev_err(chip->dev, "Failed to read charging status ret=%d\n",
rc);
return rc;
}
- if (stat[1] & CHARGER_ERROR_STATUS_BAT_OV_BIT) {
+ rc = smbx_ov_status(chip);
+ if (rc < 0)
+ return rc;
+
+ /* In overvoltage state */
+ if (rc == 1) {
*val = POWER_SUPPLY_STATUS_NOT_CHARGING;
return 0;
}
- stat[0] = stat[0] & BATTERY_CHARGER_STATUS_MASK;
+ stat = stat & BATTERY_CHARGER_STATUS_MASK;
- switch (stat[0]) {
+ switch (stat) {
case TRICKLE_CHARGE:
case PRE_CHARGE:
case FAST_CHARGE:
@@ -522,7 +411,7 @@ static int smb_get_prop_status(struct smb_chip *chip, int *val)
static inline int smb_get_current_limit(struct smb_chip *chip,
unsigned int *val)
{
- int rc = regmap_read(chip->regmap, chip->base + ICL_STATUS, val);
+ int rc = regmap_read(chip->regmap, chip->base + ICL_STATUS(chip), val);
if (rc >= 0)
*val *= CURRENT_SCALE_FACTOR;
@@ -584,7 +473,7 @@ static void smb_status_change_work(struct work_struct *work)
current_ua = CDP_CURRENT_UA;
break;
case POWER_SUPPLY_USB_TYPE_DCP:
- current_ua = DCP_CURRENT_UA;
+ current_ua = chip->batt_info->constant_charge_current_max_ua;
break;
case POWER_SUPPLY_USB_TYPE_SDP:
default:
@@ -617,7 +506,44 @@ static int smb_get_iio_chan(struct smb_chip *chip, struct iio_channel *chan,
return iio_read_channel_processed(chan, val);
}
-static int smb_get_prop_health(struct smb_chip *chip, int *val)
+static int smb5_get_prop_health(struct smb_chip *chip, int *val)
+{
+ int rc;
+ unsigned int stat;
+
+ rc = smbx_ov_status(chip);
+
+ /* Treat any error as if we are in the overvoltage state */
+ if (rc < 0)
+ dev_err(chip->dev, "Couldn't determine overvoltage status!");
+ if (rc) {
+ dev_err(chip->dev, "battery over-voltage");
+ *val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
+ return 0;
+ }
+
+ rc = regmap_read(chip->regmap, chip->base + BATTERY_CHARGER_STATUS_7,
+ &stat);
+ if (rc < 0) {
+ dev_err(chip->dev, "Couldn't read charger status 7 rc=%d\n", rc);
+ return rc;
+ }
+
+ if (stat & SMB5_BAT_TEMP_STATUS_TOO_COLD_BIT)
+ *val = POWER_SUPPLY_HEALTH_COLD;
+ else if (stat & SMB5_BAT_TEMP_STATUS_TOO_HOT_BIT)
+ *val = POWER_SUPPLY_HEALTH_OVERHEAT;
+ else if (stat & SMB5_BAT_TEMP_STATUS_COLD_SOFT_BIT)
+ *val = POWER_SUPPLY_HEALTH_COOL;
+ else if (stat & SMB5_BAT_TEMP_STATUS_HOT_SOFT_BIT)
+ *val = POWER_SUPPLY_HEALTH_WARM;
+ else
+ *val = POWER_SUPPLY_HEALTH_GOOD;
+
+ return 0;
+}
+
+static int smb2_get_prop_health(struct smb_chip *chip, int *val)
{
int rc;
unsigned int stat;
@@ -630,19 +556,19 @@ static int smb_get_prop_health(struct smb_chip *chip, int *val)
}
switch (stat) {
- case CHARGER_ERROR_STATUS_BAT_OV_BIT:
+ case SMB2_CHARGER_ERROR_STATUS_BAT_OV_BIT:
*val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
return 0;
- case BAT_TEMP_STATUS_TOO_COLD_BIT:
+ case SMB2_BAT_TEMP_STATUS_TOO_COLD_BIT:
*val = POWER_SUPPLY_HEALTH_COLD;
return 0;
- case BAT_TEMP_STATUS_TOO_HOT_BIT:
+ case SMB2_BAT_TEMP_STATUS_TOO_HOT_BIT:
*val = POWER_SUPPLY_HEALTH_OVERHEAT;
return 0;
- case BAT_TEMP_STATUS_COLD_SOFT_LIMIT_BIT:
+ case SMB2_BAT_TEMP_STATUS_COLD_SOFT_LIMIT_BIT:
*val = POWER_SUPPLY_HEALTH_COOL;
return 0;
- case BAT_TEMP_STATUS_HOT_SOFT_LIMIT_BIT:
+ case SMB2_BAT_TEMP_STATUS_HOT_SOFT_LIMIT_BIT:
*val = POWER_SUPPLY_HEALTH_WARM;
return 0;
default:
@@ -651,11 +577,25 @@ static int smb_get_prop_health(struct smb_chip *chip, int *val)
}
}
+static int smb_get_prop_health(struct smb_chip *chip, int *val)
+{
+ switch (chip->gen) {
+ case SMB2:
+ return smb2_get_prop_health(chip, val);
+ case SMB5:
+ return smb5_get_prop_health(chip, val);
+ default:
+ dev_err(chip->dev, "Unsupported SMB chip generation\n");
+ return -EINVAL;
+ }
+}
+
static int smb_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct smb_chip *chip = power_supply_get_drvdata(psy);
+ int ret;
switch (psp) {
case POWER_SUPPLY_PROP_MANUFACTURER:
@@ -670,8 +610,13 @@ static int smb_get_property(struct power_supply *psy,
return smb_get_iio_chan(chip, chip->usb_in_i_chan,
&val->intval);
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- return smb_get_iio_chan(chip, chip->usb_in_v_chan,
+ ret = smb_get_iio_chan(chip, chip->usb_in_v_chan,
&val->intval);
+ if (!ret) {
+ if (chip->gen == SMB5)
+ val->intval *= 16;
+ }
+ return ret;
case POWER_SUPPLY_PROP_ONLINE:
return smb_get_prop_usb_online(chip, &val->intval);
case POWER_SUPPLY_PROP_STATUS:
@@ -693,6 +638,9 @@ static int smb_set_property(struct power_supply *psy,
struct smb_chip *chip = power_supply_get_drvdata(psy);
switch (psp) {
+ case POWER_SUPPLY_PROP_STATUS:
+ return regmap_update_bits(chip->regmap, chip->base + USBIN_CMD_IL,
+ USBIN_SUSPEND_BIT, !val->intval);
case POWER_SUPPLY_PROP_CURRENT_MAX:
return smb_set_current_limit(chip, val->intval);
default:
@@ -705,6 +653,7 @@ static int smb_property_is_writable(struct power_supply *psy,
enum power_supply_property psp)
{
switch (psp) {
+ case POWER_SUPPLY_PROP_STATUS:
case POWER_SUPPLY_PROP_CURRENT_MAX:
return 1;
default:
@@ -715,12 +664,8 @@ static int smb_property_is_writable(struct power_supply *psy,
static irqreturn_t smb_handle_batt_overvoltage(int irq, void *data)
{
struct smb_chip *chip = data;
- unsigned int status;
- regmap_read(chip->regmap, chip->base + BATTERY_CHARGER_STATUS_2,
- &status);
-
- if (status & CHARGER_ERROR_STATUS_BAT_OV_BIT) {
+ if (smbx_ov_status(chip) == 1) {
/* The hardware stops charging automatically */
dev_err(chip->dev, "battery overvoltage detected\n");
power_supply_changed(chip->chg_psy);
@@ -766,7 +711,7 @@ static irqreturn_t smb_handle_wdog_bark(int irq, void *data)
}
static const struct power_supply_desc smb_psy_desc = {
- .name = "pmi8998_charger",
+ .name = "SMB2_charger",
.type = POWER_SUPPLY_TYPE_USB,
.usb_types = BIT(POWER_SUPPLY_USB_TYPE_SDP) |
BIT(POWER_SUPPLY_USB_TYPE_CDP) |
@@ -780,16 +725,98 @@ static const struct power_supply_desc smb_psy_desc = {
};
/* Init sequence derived from vendor downstream driver */
-static const struct smb_init_register smb_init_seq[] = {
- { .addr = AICL_RERUN_TIME_CFG, .mask = AICL_RERUN_TIME_MASK, .val = 0 },
+static const struct smb_init_register smb5_init_seq[] = {
+ { .addr = USBIN_CMD_IL, .mask = USBIN_SUSPEND_BIT, .val = 0 },
+ /*
+ * By default configure us as an upstream facing port
+ * FIXME: This will be handled by the type-c driver
+ */
+ { .addr = SMB5_TYPE_C_MODE_CFG,
+ .mask = SMB5_EN_TRY_SNK_BIT | SMB5_EN_SNK_ONLY_BIT,
+ .val = SMB5_EN_TRY_SNK_BIT },
+ { .addr = SMB5_TYPEC_TYPE_C_VCONN_CONTROL,
+ .mask = SMB5_VCONN_EN_ORIENTATION_BIT | SMB5_VCONN_EN_SRC_BIT |
+ SMB5_VCONN_EN_VALUE_BIT,
+ .val = SMB2_VCONN_EN_SRC_BIT },
+ { .addr = SMB5_DEBUG_ACCESS_SRC_CFG,
+ .mask = SMB5_EN_UNORIENTED_DEBUG_ACCESS_SRC_BIT,
+ .val = SMB5_EN_UNORIENTED_DEBUG_ACCESS_SRC_BIT },
+ { .addr = SMB5_TYPE_C_EXIT_STATE_CFG,
+ .mask = SMB5_SEL_SRC_UPPER_REF_BIT,
+ .val = SMB5_SEL_SRC_UPPER_REF_BIT },
+ /*
+ * Disable Type-C factory mode and stay in Attached.SRC state when VCONN
+ * over-current happens
+ */
+ { .addr = TYPE_C_CFG,
+ .mask = APSD_START_ON_CC_BIT,
+ .val = 0 },
+ { .addr = SMB5_TYPE_C_DEBUG_ACCESS_SINK,
+ .mask = SMB5_TYPEC_DEBUG_ACCESS_SINK_MASK,
+ .val = 0x17 },
+ /* Configure VBUS for software control */
+ { .addr = OTG_CFG, .mask = OTG_EN_SRC_CFG_BIT, .val = 0 },
+ /*
+ * Recharge when State Of Charge drops below 98%.
+ */
+ { .addr = SMB5_CHARGE_RCHG_SOC_THRESHOLD_CFG_REG,
+ .mask = SMB5_CHARGE_RCHG_SOC_THRESHOLD_CFG_MASK,
+ .val = 250 },
+ /* Enable charging */
+ { .addr = CHARGING_ENABLE_CMD,
+ .mask = CHARGING_ENABLE_CMD_BIT,
+ .val = CHARGING_ENABLE_CMD_BIT },
+ /* Enable BC1P2 auto Src detect */
+ { .addr = USBIN_OPTIONS_1_CFG,
+ .mask = AUTO_SRC_DETECT_BIT,
+ .val = AUTO_SRC_DETECT_BIT },
+ /* Set the default SDP charger type to a 500ma USB 2.0 port */
+ { .addr = USBIN_ICL_OPTIONS,
+ .mask = USBIN_MODE_CHG_BIT,
+ .val = USBIN_MODE_CHG_BIT },
+ { .addr = CMD_ICL_OVERRIDE,
+ .mask = ICL_OVERRIDE_BIT,
+ .val = 0 },
+ { .addr = USBIN_LOAD_CFG,
+ .mask = ICL_OVERRIDE_AFTER_APSD_BIT,
+ .val = 0 },
+ /* Disable watchdog */
+ { .addr = SNARL_BARK_BITE_WD_CFG, .mask = 0xff, .val = 0 },
+ { .addr = WD_CFG,
+ .mask = WATCHDOG_TRIGGER_AFP_EN_BIT | WDOG_TIMER_EN_ON_PLUGIN_BIT |
+ BARK_WDOG_INT_EN_BIT,
+ .val = 0 },
+ /*
+ * Enable Automatic Input Current Limit, this will slowly ramp up the current
+ * When connected to a wall charger, and automatically stop when it detects
+ * the charger current limit (voltage drop?) or it reaches the programmed limit.
+ */
+ { .addr = USBIN_AICL_OPTIONS_CFG,
+ .mask = USBIN_AICL_PERIODIC_RERUN_EN_BIT | USBIN_AICL_ADC_EN_BIT
+ | USBIN_AICL_EN_BIT | SUSPEND_ON_COLLAPSE_USBIN_BIT,
+ .val = USBIN_AICL_PERIODIC_RERUN_EN_BIT | USBIN_AICL_ADC_EN_BIT
+ | USBIN_AICL_EN_BIT | SUSPEND_ON_COLLAPSE_USBIN_BIT },
+ /*
+ * This overrides all of the other current limit configs and is
+ * expected to be used for setting limits based on temperature.
+ * We set some relatively safe default value while still allowing
+ * a comfortably fast charging rate.
+ */
+ { .addr = FAST_CHARGE_CURRENT_CFG,
+ .mask = FAST_CHARGE_CURRENT_SETTING_MASK,
+ .val = 1950000 / CURRENT_SCALE_FACTOR },
+};
+
+/* Init sequence derived from vendor downstream driver */
+static const struct smb_init_register smb2_init_seq[] = {
/*
* By default configure us as an upstream facing port
* FIXME: This will be handled by the type-c driver
*/
{ .addr = TYPE_C_INTRPT_ENB_SOFTWARE_CTRL,
- .mask = TYPEC_POWER_ROLE_CMD_MASK | VCONN_EN_SRC_BIT |
+ .mask = TYPEC_POWER_ROLE_CMD_MASK | SMB2_VCONN_EN_SRC_BIT |
VCONN_EN_VALUE_BIT,
- .val = VCONN_EN_SRC_BIT },
+ .val = SMB2_VCONN_EN_SRC_BIT },
/*
* Disable Type-C factory mode and stay in Attached.SRC state when VCONN
* over-current happens
@@ -803,10 +830,10 @@ static const struct smb_init_register smb_init_seq[] = {
* Use VBAT to determine the recharge threshold when battery is full
* rather than the state of charge.
*/
- { .addr = FG_UPDATE_CFG_2_SEL,
- .mask = SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT |
- VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT,
- .val = VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT },
+ { .addr = SMB2_FG_UPDATE_CFG_2_SEL,
+ .mask = SMB2_SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT |
+ SMB2_VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT,
+ .val = SMB2_VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT },
/* Enable charging */
{ .addr = USBIN_OPTIONS_1_CFG, .mask = HVDCP_EN_BIT, .val = 0 },
{ .addr = CHARGING_ENABLE_CMD,
@@ -872,27 +899,48 @@ static const struct smb_init_register smb_init_seq[] = {
{ .addr = PRE_CHARGE_CURRENT_CFG,
.mask = PRE_CHARGE_CURRENT_SETTING_MASK,
.val = 500000 / CURRENT_SCALE_FACTOR },
- /*
- * This overrides all of the current limit options exposed to userspace
- * and prevents the device from pulling more than ~1A. This is done
- * to minimise potential fire hazard risks.
- */
- { .addr = FAST_CHARGE_CURRENT_CFG,
- .mask = FAST_CHARGE_CURRENT_SETTING_MASK,
- .val = 1000000 / CURRENT_SCALE_FACTOR },
};
-static int smb_init_hw(struct smb_chip *chip)
+struct smb_match_data pmi8998_match_data = {
+ .init_seq = smb2_init_seq,
+ .init_seq_len = ARRAY_SIZE(smb2_init_seq),
+ .name = "pmi8998",
+ .gen = SMB2,
+};
+
+struct smb_match_data pm660_match_data = {
+ .init_seq = smb2_init_seq,
+ .init_seq_len = ARRAY_SIZE(smb2_init_seq),
+ .name = "pm660",
+ .gen = SMB2,
+};
+
+struct smb_match_data pm8150b_match_data = {
+ .init_seq = smb5_init_seq,
+ .init_seq_len = ARRAY_SIZE(smb5_init_seq),
+ .name = "pm8150b",
+ .gen = SMB5,
+};
+
+struct smb_match_data pm7250b_match_data = {
+ .init_seq = smb5_init_seq,
+ .init_seq_len = ARRAY_SIZE(smb5_init_seq),
+ .name = "pm7250b",
+ .gen = SMB5,
+};
+
+
+static int smb_init_hw(struct smb_chip *chip, const struct smb_init_register *init_seq, size_t len)
{
int rc, i;
- for (i = 0; i < ARRAY_SIZE(smb_init_seq); i++) {
+ for (i = 0; i < len; i++) {
dev_dbg(chip->dev, "%d: Writing 0x%02x to 0x%02x\n", i,
- smb_init_seq[i].val, smb_init_seq[i].addr);
+ init_seq[i].val, init_seq[i].addr);
rc = regmap_update_bits(chip->regmap,
- chip->base + smb_init_seq[i].addr,
- smb_init_seq[i].mask,
- smb_init_seq[i].val);
+ chip->base + init_seq[i].addr,
+ init_seq[i].mask,
+ init_seq[i].val);
if (rc < 0)
return dev_err_probe(chip->dev, rc,
"%s: init command %d failed\n",
@@ -929,6 +977,7 @@ static int smb_probe(struct platform_device *pdev)
struct power_supply_config supply_config = {};
struct power_supply_desc *desc;
struct smb_chip *chip;
+ const struct smb_match_data *match_data;
int rc, irq;
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
@@ -959,7 +1008,13 @@ static int smb_probe(struct platform_device *pdev)
"Couldn't get usbin_i IIO channel\n");
}
- rc = smb_init_hw(chip);
+ match_data = (const struct smb_match_data *)device_get_match_data(chip->dev);
+
+ chip->gen = match_data->gen;
+
+ dev_info(chip->dev, "Generation %s\n", chip->gen == SMB2 ? "SMB2" : "SMB5");
+
+ rc = smb_init_hw(chip, match_data->init_seq, match_data->init_seq_len);
if (rc < 0)
return rc;
@@ -972,7 +1027,7 @@ static int smb_probe(struct platform_device *pdev)
memcpy(desc, &smb_psy_desc, sizeof(smb_psy_desc));
desc->name =
devm_kasprintf(chip->dev, GFP_KERNEL, "%s-charger",
- (const char *)device_get_match_data(chip->dev));
+ match_data->name);
if (!desc->name)
return -ENOMEM;
@@ -986,6 +1041,8 @@ static int smb_probe(struct platform_device *pdev)
if (rc)
return dev_err_probe(chip->dev, rc,
"Failed to get battery info\n");
+ if (chip->batt_info->constant_charge_current_max_ua == -EINVAL)
+ chip->batt_info->constant_charge_current_max_ua = DCP_CURRENT_UA;
rc = devm_delayed_work_autocancel(chip->dev, &chip->status_change_work,
smb_status_change_work);
@@ -1024,6 +1081,26 @@ static int smb_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, chip);
+ /*
+ * This overrides all of the other current limits and is expected
+ * to be used for setting limits based on temperature. We set some
+ * relatively safe default value while still allowing a comfortably
+ * fast charging rate. Once temperature monitoring is hooked up we
+ * would expect this to be changed dynamically based on temperature
+ * reporting.
+ */
+ rc = regmap_write(chip->regmap, chip->base + FAST_CHARGE_CURRENT_CFG,
+ 1950000 / CURRENT_SCALE_FACTOR);
+ if (rc < 0)
+ return dev_err_probe(chip->dev, rc,
+ "Couldn't write fast charge current cfg");
+
+ rc = regmap_write_bits(chip->regmap, chip->base + AICL_RERUN_TIME_CFG,
+ AICL_RERUN_TIME_MASK, AIC_RERUN_TIME_3_SECS);
+ if (rc < 0)
+ return dev_err_probe(chip->dev, rc,
+ "Couldn't write fast AICL rerun time");
+
/* Initialise charger state */
schedule_delayed_work(&chip->status_change_work, 0);
@@ -1031,8 +1108,10 @@ static int smb_probe(struct platform_device *pdev)
}
static const struct of_device_id smb_match_id_table[] = {
- { .compatible = "qcom,pmi8998-charger", .data = "pmi8998" },
- { .compatible = "qcom,pm660-charger", .data = "pm660" },
+ { .compatible = "qcom,pmi8998-charger", .data = &pmi8998_match_data },
+ { .compatible = "qcom,pm660-charger", .data = &pm660_match_data },
+ { .compatible = "qcom,pm7250b-charger", .data = &pm7250b_match_data },
+ { .compatible = "qcom,pm8150b-charger", .data = &pm8150b_match_data },
{ /* sentinal */ }
};
MODULE_DEVICE_TABLE(of, smb_match_id_table);
@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Wed, 11 Nov 2026 08:00:00 +0000
Subject: [PATCH 04/25] of: property: link a remote-endpoint to the remote
port, from the SM8150 fork
The qualcomm-sm8150 fork (gitlab.nura.eco/soc/qualcomm-sm8150/linux.git,
8e126dbc4) makes fw_devlink link a remote-endpoint to the remote port
instead of the port's parent device. Carried as the fork has it, because
the kernel that runs on the phone has it; whether hotdogb needs it is not
measured yet.
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 50d95d512..b102e3358 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1512,7 +1512,7 @@ static struct device_node *parse_remote_endpoint(struct device_node *np,
if (index > 0 || strcmp(prop_name, "remote-endpoint"))
return NULL;
- return of_graph_get_remote_port_parent(np);
+ return of_graph_get_remote_port(np);
}
static const struct supplier_bindings of_supplier_bindings[] = {
@@ -1,45 +0,0 @@
From 758e62731d47b911ef3f9f0400b55737a8964169 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 08:20:19 +0000
Subject: [PATCH 5/6] clk: qcom: dispcc-sm8250: enable the parent of the pixel
RCGs while configuring them
An RCG takes a new configuration only while its new parent runs. The
pixel clock sources are fed by the DSI PLL, which is off when msm sets
their rate at the first modeset, and every boot of the OnePlus 7T
(SM8150, which uses this driver) logged
disp_cc_mdss_pclk0_clk_src: rcg didn't update its configuration.
with a WARNING from update_config. sdm845's dispcc, the predecessor,
sets CLK_OPS_PARENT_ENABLE on the same two clocks; do the same here.
Measured: the warning is gone, the display comes up as before.
---
drivers/clk/qcom/dispcc-sm8250.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/dispcc-sm8250.c b/drivers/clk/qcom/dispcc-sm8250.c
index 8f433e1e7..d021cf2f2 100644
--- a/drivers/clk/qcom/dispcc-sm8250.c
+++ b/drivers/clk/qcom/dispcc-sm8250.c
@@ -578,7 +578,7 @@ static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
.name = "disp_cc_mdss_pclk0_clk_src",
.parent_data = disp_cc_parent_data_6,
.num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
.ops = &clk_pixel_ops,
},
};
@@ -592,7 +592,7 @@ static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
.name = "disp_cc_mdss_pclk1_clk_src",
.parent_data = disp_cc_parent_data_6,
.num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
.ops = &clk_pixel_ops,
},
};
--
2.53.0
@@ -1,8 +1,8 @@
From 818c7518fb1634684dac483d04e12f3d7047cea6 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Konrad Lother <lotherk@kitt>
Date: Sat, 7 Nov 2026 08:08:08 +0000
Subject: [PATCH 1/2] hotdogb: baseline kernel that runs on the phone (display
working)
Subject: [PATCH 05/25] hotdogb: baseline kernel that runs on the phone
(display working)
Samsung SOFEF03F DSC panel driver with bootloader handoff (enable
compression on every prepare), dsc_slice_per_pkt support in dsi_host and
@@ -49,7 +49,7 @@ index 87a822e5c..4d6bef889 100644
le64sym _kernel_flags_le // Informative flags, little-endian
.quad 0 // reserved
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index db6da9937..24d905fae 100644
index 50474c994..1c8bdd07a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -166,6 +166,7 @@ struct msm_dsi_host {
@@ -60,7 +60,7 @@ index db6da9937..24d905fae 100644
/* connected device info */
unsigned int channel;
@@ -927,17 +928,10 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
@@ -928,17 +929,10 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
slice_per_intf = dsc->slice_count;
total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
@@ -80,7 +80,7 @@ index db6da9937..24d905fae 100644
if (is_cmd_mode) /* packet data type */
reg = DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE(MIPI_DSI_DCS_LONG_WRITE);
@@ -1088,12 +1082,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
@@ -1094,12 +1088,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
else
/*
* When DSC is enabled, WC = slice_chunk_size * slice_per_pkt + 1.
@@ -95,7 +95,7 @@ index db6da9937..24d905fae 100644
dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL,
DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |
@@ -1702,8 +1693,11 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
@@ -1708,8 +1699,11 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
msm_host->lanes = dsi->lanes;
msm_host->format = dsi->format;
msm_host->mode_flags = dsi->mode_flags;
@@ -108,7 +108,7 @@ index db6da9937..24d905fae 100644
ret = dsi_dev_attach(msm_host->pdev);
if (ret)
@@ -2292,7 +2286,9 @@ int msm_dsi_host_cmd_rx(struct mipi_dsi_host *host,
@@ -2299,7 +2293,9 @@ int msm_dsi_host_cmd_rx(struct mipi_dsi_host *host,
cmd = buf[0];
switch (cmd) {
case MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT:
@@ -119,7 +119,7 @@ index db6da9937..24d905fae 100644
ret = 0;
break;
case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE:
@@ -2308,7 +2304,8 @@ int msm_dsi_host_cmd_rx(struct mipi_dsi_host *host,
@@ -2315,7 +2311,8 @@ int msm_dsi_host_cmd_rx(struct mipi_dsi_host *host,
ret = dsi_long_read_resp(buf, msg);
break;
default:
@@ -130,10 +130,10 @@ index db6da9937..24d905fae 100644
}
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 5a582ecc2..5031cd47b 100644
index 79264f7bb..64640b773 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -823,7 +823,7 @@ config DRM_PANEL_SAMSUNG_S6E3FA7
@@ -802,7 +802,7 @@ config DRM_PANEL_SAMSUNG_S6E3FA7
depends on BACKLIGHT_CLASS_DEVICE
help
Say Y here if you want to enable support for the Samsung S6E3FA7
@@ -142,7 +142,7 @@ index 5a582ecc2..5031cd47b 100644
config DRM_PANEL_SAMSUNG_S6D16D0
tristate "Samsung S6D16D0 DSI video mode panel"
@@ -1256,3 +1256,12 @@ config DRM_PANEL_XINPENG_XPP055C272
@@ -1225,3 +1225,12 @@ config DRM_PANEL_XINPENG_XPP055C272
XPP055C272 controller for 720x1280 LCD panels with MIPI/RGB/SPI
system interfaces.
endmenu
@@ -156,10 +156,10 @@ index 5a582ecc2..5031cd47b 100644
+ help
+ Samsung command-mode DSC panel used by the OnePlus 7T/7T Pro.
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index e96f089f7..5e2916a1e 100644
index aeffaa956..0c5a3523a 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -124,3 +124,4 @@ obj-$(CONFIG_DRM_PANEL_VISIONOX_VTDR6130) += panel-visionox-vtdr6130.o
@@ -121,3 +121,4 @@ obj-$(CONFIG_DRM_PANEL_VISIONOX_VTDR6130) += panel-visionox-vtdr6130.o
obj-$(CONFIG_DRM_PANEL_VISIONOX_R66451) += panel-visionox-r66451.o
obj-$(CONFIG_DRM_PANEL_WIDECHIPS_WS2401) += panel-widechips-ws2401.o
obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
@@ -848,6 +848,3 @@ index 2464bcbd0..ace73c6b3 100644
/* Now attempt to add the string, but only if the string with the same
* contents doesn't exist already (HASHMAP_ADD strategy). If such
--
2.53.0
@@ -1,7 +1,7 @@
From 2509837001fcfe9bdc0a6c40dcf308e927be648b Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sat, 7 Nov 2026 08:35:24 +0000
Subject: [PATCH 2/2] panel-samsung-oneplus-dsc: enable compression only when
Subject: [PATCH 06/25] panel-samsung-oneplus-dsc: enable compression only when
the panel reports it off
Measured on hardware: the bootloader leaves compression_mode at 0x00 on
@@ -70,6 +70,3 @@ index 0928f60ba..f80d7515d 100644
}
}
return 0;
--
2.53.0
@@ -1,8 +1,8 @@
From e634e5b247d2e7441244cb4ec66cd489a66977a2 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sat, 7 Nov 2026 20:03:14 +0000
Subject: [PATCH] drm/msm/dpu: stop the bootloader's scanout before attaching
the IOMMU
Subject: [PATCH 07/25] drm/msm/dpu: stop the bootloader's scanout before
attaching the IOMMU
The bootloader of the OnePlus 7T (sm8150, DPU 5.0, command-mode DSC
panel) leaves the INTF tear check's autorefresh on (intf_1:
@@ -28,7 +28,7 @@ on the panel.
1 file changed, 72 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 61d7e6546..27d9d7748 100644
index 014b2c504..7503c28f9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -1106,6 +1106,76 @@ static void _dpu_kms_mmu_destroy(struct dpu_kms *dpu_kms)
@@ -117,6 +117,3 @@ index 61d7e6546..27d9d7748 100644
rc = _dpu_kms_mmu_init(dpu_kms);
if (rc) {
DPU_ERROR("dpu_kms_mmu_init failed: %d\n", rc);
--
2.53.0
@@ -1,8 +1,8 @@
From 049b8cd43b350ab6773eb2ab5f5a2081f968f1f1 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 07:31:43 +0000
Subject: [PATCH] drm/msm/mdss: keep the MDSS active until the DPU stopped the
boot scanout
Subject: [PATCH 08/25] drm/msm/mdss: keep the MDSS active until the DPU
stopped the boot scanout
The bootloader may leave the display running; on a command-mode panel
with autorefresh, the MDP keeps fetching its framebuffer from memory.
@@ -27,7 +27,7 @@ Measured: 0 crawls in 20 warm reboots, MDSS probe at most 27 ms; before,
3 files changed, 53 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 27d9d7748..9517b5664 100644
index 7503c28f9..fc29d0ef6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -1255,6 +1255,12 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
@@ -44,10 +44,10 @@ index 27d9d7748..9517b5664 100644
if (rc) {
DPU_ERROR("dpu_kms_mmu_init failed: %d\n", rc);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 6d847d593..f94dcf679 100644
index 617b3c4b4..cceac5484 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -429,9 +429,11 @@ static inline void msm_dpu_unregister(void) {}
@@ -422,9 +422,11 @@ static inline void msm_dpu_unregister(void) {}
#ifdef CONFIG_DRM_MSM_MDSS
void msm_mdss_register(void);
void msm_mdss_unregister(void);
@@ -143,6 +143,3 @@ index 9047e8d9e..939715515 100644
void __init msm_mdss_register(void)
{
platform_driver_register(&mdss_platform_driver);
--
2.53.0
@@ -1,8 +1,8 @@
From 1299aab931714fd5c5a736597be530367717c666 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 08:20:20 +0000
Subject: [PATCH 6/6] drm/msm/dsi: report ACK errors, and count only real FIFO
errors
Subject: [PATCH 09/25] drm/msm/dsi: report ACK errors, and count only real
FIFO errors
Two bugs hid the cause of a DSI error interrupt:
@@ -23,7 +23,7 @@ on the first read after msm takes the link over from the bootloader
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 24d905fae..dca3031b1 100644
index 1c8bdd07a..f2e0164c1 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -85,7 +85,7 @@ static int dsi_get_version(const void __iomem *base, u32 *major, u32 *minor)
@@ -43,7 +43,7 @@ index 24d905fae..dca3031b1 100644
struct work_struct err_work;
struct workqueue_struct *workqueue;
@@ -1543,7 +1544,11 @@ static void dsi_err_worker(struct work_struct *work)
@@ -1549,7 +1550,11 @@ static void dsi_err_worker(struct work_struct *work)
container_of(work, struct msm_dsi_host, err_work);
u32 status = msm_host->err_work_state;
@@ -56,7 +56,7 @@ index 24d905fae..dca3031b1 100644
if (status & DSI_ERR_STATE_MDP_FIFO_UNDERFLOW)
dsi_sw_reset(msm_host);
@@ -1564,6 +1569,7 @@ static void dsi_ack_err_status(struct msm_dsi_host *msm_host)
@@ -1570,6 +1575,7 @@ static void dsi_ack_err_status(struct msm_dsi_host *msm_host)
dsi_write(msm_host, REG_DSI_ACK_ERR_STATUS, status);
/* Writing of an extra 0 needed to clear error bits */
dsi_write(msm_host, REG_DSI_ACK_ERR_STATUS, 0);
@@ -64,7 +64,7 @@ index 24d905fae..dca3031b1 100644
msm_host->err_work_state |= DSI_ERR_STATE_ACK;
}
}
@@ -1602,7 +1608,26 @@ static void dsi_fifo_status(struct msm_dsi_host *msm_host)
@@ -1608,7 +1614,26 @@ static void dsi_fifo_status(struct msm_dsi_host *msm_host)
status = dsi_read(msm_host, REG_DSI_FIFO_STATUS);
@@ -92,6 +92,3 @@ index 24d905fae..dca3031b1 100644
if (status) {
dsi_write(msm_host, REG_DSI_FIFO_STATUS, status);
msm_host->err_work_state |= DSI_ERR_STATE_FIFO;
--
2.53.0
@@ -1,7 +1,7 @@
From 2cf08ce6554800288b0a5c05aaa1fa6aa15c497e Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 12:32:57 +0000
Subject: [PATCH 07/12] arm64: dts: qcom: sm8150-oneplus-hotdogb: the DTS of
Subject: [PATCH 10/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: the DTS of
the baseline that runs on the phone
The DTS of the DTB the phone booted with (sm8150-617, branch hotdogb-dts,
@@ -265,6 +265,3 @@ index 7ba966a83..a5f3e8154 100644
+
+&tlmm {
+};
--
2.53.0
@@ -1,7 +1,7 @@
From 86b3f1d5fd8c87bd5f35b87de82b73b188fc778b Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 12:52:05 +0000
Subject: [PATCH 08/12] arm64: dts: qcom: sm8150-oneplus-hotdogb: reserve the
Subject: [PATCH 11/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: reserve the
bootloader's framebuffer
ABL scans out of 0x9c000000 until the DPU stops it, and the DT gave the
@@ -48,6 +48,3 @@ index a5f3e8154..f3b8c9f92 100644
cdsp_sec_regions: memory@a4c00000 {
compatible = "removed-dma-pool";
no-map;
--
2.53.0
@@ -1,7 +1,7 @@
From 9223d4e76f6a424818cd2a134d2fc46edaef7bdd Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 12:52:06 +0000
Subject: [PATCH 09/12] drm/msm: fbdev: mark the framebuffer as system memory
Subject: [PATCH 12/25] drm/msm: fbdev: mark the framebuffer as system memory
msm_fbdev draws with the fbdev sys_* helpers into a kernel mapping of a GEM
object, but never set FBINFO_VIRTFB, so the first blit warns
@@ -24,6 +24,3 @@ index fd19995b1..8cab9f47a 100644
fbi->screen_size = bo->size;
fbi->fix.smem_start = paddr;
fbi->fix.smem_len = bo->size;
--
2.53.0
@@ -1,7 +1,7 @@
From 74c09af009e031ed9c04d0c99903922f452fa3ec Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 13:02:48 +0000
Subject: [PATCH 10/12] arm64: dts: qcom: sm8150: do not reset the Ethernet MAC
Subject: [PATCH 13/25] arm64: dts: qcom: sm8150: do not reset the Ethernet MAC
for the MDSS
The MDSS node named DISP_CC_MDSS_CORE_BCR (0) on the GCC, where index 0 is
@@ -37,6 +37,3 @@ index 079e2f0a6..aa6f1f527 100644
status = "disabled";
--
2.53.0
@@ -1,7 +1,7 @@
From 3d36f0b94447d3ca6cd09178b2d2f0b732e3383b Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 12:54:13 +0000
Subject: [PATCH 11/12] usb: gadget: u_serial: close a hung-up port once
Subject: [PATCH 14/25] usb: gadget: u_serial: close a hung-up port once
login hangs its tty up (vhangup). u_serial has no hangup op, and while the
port is the console (console=ttyGS0, /dev/console held by init) the tty core
@@ -89,6 +89,3 @@ index e43ad6373..e047e3740 100644
.write = gs_write,
.put_char = gs_put_char,
.flush_chars = gs_flush_chars,
--
2.53.0
@@ -1,7 +1,7 @@
From 3c5fa409ca545f8f9bddf50b3eb72477e6a90328 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 13:03:55 +0000
Subject: [PATCH 12/12] arm64: dts: qcom: sm8150-oneplus-hotdogb: USB dual role
Subject: [PATCH 15/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: USB dual role
(OTG)
DWC3 was a peripheral only. Make it dual role with a role switch, enable
@@ -95,6 +95,3 @@ index f3b8c9f92..e0e786a00 100644
&mdss {
status = "okay";
};
--
2.53.0
@@ -1,8 +1,8 @@
From 3dbbccd538053c712d18a3dfd7bc0099adb97cae Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 14:21:10 +0000
Subject: [PATCH] arm64: dts: qcom: sm8150-oneplus-hotdogb: Bluetooth (WCN3998
on uart13)
Subject: [PATCH 16/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: Bluetooth
(WCN3998 on uart13)
The WCN3998 on uart13 (gpio43-46, qup13, pin states of the downstream
sm8150-pinctrl.dtsi), with the supplies of the SM8150 reference design the
@@ -83,6 +83,3 @@ index e0e786a00..995646d87 100644
+ };
+ };
};
--
2.53.0
@@ -1,7 +1,7 @@
From d4af8bcc45bd5bbd817a387ec281e94a7d1a9343 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 15:04:25 +0000
Subject: [PATCH 14/15] wifi: ath10k: snoc: optionally keep the WCN powered
Subject: [PATCH 17/25] wifi: ath10k: snoc: optionally keep the WCN powered
from probe
On sm8150 the WLAN firmware (WLAN.HL.3.0, on the modem) touches the WCN
@@ -85,6 +85,3 @@ index 1ecae3468..1fbaf2b03 100644
bool xo_cal_supported;
u32 xo_cal_data;
DECLARE_BITMAP(pending_ce_irqs, CE_COUNT_MAX);
--
2.53.0
@@ -1,7 +1,7 @@
From 1718c80ab35bb71d74e9e958ed8532d333e38605 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 15:04:25 +0000
Subject: [PATCH 15/15] arm64: dts: qcom: sm8150-oneplus-hotdogb: modem and
Subject: [PATCH 18/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: modem and
WLAN
- The modem (mpss), with its firmware from the phone's own modem partition
@@ -81,6 +81,3 @@ index 995646d87..89d6b53b9 100644
};
&adsp_mem {
--
2.53.0
@@ -1,8 +1,8 @@
From 6c04bd02faabb041e302532cead5afbd6841a82e Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 15:17:22 +0000
Subject: [PATCH] arm64: dts: qcom: sm8150-oneplus-hotdogb: charger, battery
and fuel gauge
Subject: [PATCH 19/25] arm64: dts: qcom: sm8150-oneplus-hotdogb: charger,
battery and fuel gauge
- The pm8150b charger (qcom_smbx) with the 7T's battery (stock DT with its
DTBO, project 18865: 3800 mAh, full at 4.4 V). Without it the PMIC kept
@@ -70,6 +70,3 @@ index 89d6b53b9..48fa25656 100644
&pm8150b_vbus {
regulator-min-microamp = <500000>;
regulator-max-microamp = <1500000>;
--
2.53.0
@@ -1,8 +1,8 @@
From 182092338bf56b4f4fc6494850bd3552a0428af7 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 15:50:08 +0000
Subject: [PATCH] drm/msm/dpu: clear the bootloader's blend stages when taking
over
Subject: [PATCH 20/25] drm/msm/dpu: clear the bootloader's blend stages when
taking over
0003 stops the bootloader's autorefresh and timing engine, but its blend
stages stay in its CTL: on hotdogb ABL leaves ctl_0 staging sspp_0 on LM_0
@@ -21,7 +21,7 @@ cleared stages with msm's own.
1 file changed, 42 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 9517b5664..d27e1e582 100644
index fc29d0ef6..6962a96ba 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -1170,6 +1170,48 @@ static void _dpu_kms_stop_boot_scanout(struct dpu_kms *dpu_kms)
@@ -73,6 +73,3 @@ index 9517b5664..d27e1e582 100644
if (stopped) {
wmb();
mdelay(20); /* one frame at 60 Hz, as mdp5 waits 16 ms */
--
2.53.0
@@ -1,8 +1,8 @@
From 6b20b1b0632344104e2ab0fcce2f44796e161c2d Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 17:16:17 +0000
Subject: [PATCH] arm64: dts: qcom: sm8150: let qcom_scm clear the download
mode
Subject: [PATCH 21/25] arm64: dts: qcom: sm8150: let qcom_scm clear the
download mode
The bootloader sets the download-mode bit so that an unclean reset ends in
Qualcomm's crash-dump mode (USB 05c6:900e, screen dark): a phone that hung
@@ -46,6 +46,3 @@ index aa6f1f527..5dc674dc9 100644
remoteproc_slpi: remoteproc@2400000 {
compatible = "qcom,sm8150-slpi-pas";
reg = <0x0 0x02400000 0x0 0x4040>;
--
2.53.0
@@ -1,8 +1,8 @@
From b81725c5c16854aff703f42e9b94d753b0ca9175 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 19:15:49 +0000
Subject: [PATCH] drm/panel: samsung-oneplus-dsc: initialise the panel instead
of taking it over
Subject: [PATCH 22/25] drm/panel: samsung-oneplus-dsc: initialise the panel
instead of taking it over
Taking the panel over as ABL left it (handoff, the default so far) gave a
white panel in 25 of 90 boots of the OnePlus 7T, counted with a camera on
@@ -44,6 +44,3 @@ index f80d7515d..a8716caa9 100644
static bool handoff_pps;
module_param(handoff_pps, bool, 0644);
--
2.53.0
@@ -1,8 +1,8 @@
From 425f6d5c494a9193d14e5983350f9423b8afb3af Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Tue, 10 Nov 2026 06:19:56 +0000
Subject: [PATCH] Bluetooth: hci_qca: drop pending output before reopening the
UART on a retry
Subject: [PATCH 23/25] Bluetooth: hci_qca: drop pending output before
reopening the UART on a retry
When the setup of a WCN399x fails, qca_setup() powers the controller off
and reopens the UART for the next try. The close waited in
@@ -20,10 +20,10 @@ Flush the output before the close.
1 file changed, 7 insertions(+)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index bb9f002aa..a8f65b6f2 100644
index e4c6b81c7..1306fa5e6 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2052,6 +2052,13 @@ static int qca_setup(struct hci_uart *hu)
@@ -2051,6 +2051,13 @@ static int qca_setup(struct hci_uart *hu)
if (retries < MAX_INIT_RETRIES) {
bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
if (hu->serdev) {
@@ -37,6 +37,3 @@ index bb9f002aa..a8f65b6f2 100644
serdev_device_close(hu->serdev);
ret = serdev_device_open(hu->serdev);
if (ret) {
--
2.53.0
@@ -1,7 +1,7 @@
From aa863080e83c5a4ee3076d4852c3465d66ea3ced Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Tue, 10 Nov 2026 07:57:36 +0000
Subject: [PATCH] fbdev: logo: keep the boot logos after init
Subject: [PATCH 24/25] fbdev: logo: keep the boot logos after init
The logos were __initconst and fb_find_logo() refused them after
late_initcall_sync. A display driver that registers its framebuffer late
@@ -81,6 +81,3 @@ index 28d9f0b90..81527ae76 100644
logoname);
write_hex_cnt = 0;
for (i = 0; i < logo_clutsize; i++) {
--
2.53.0
@@ -1,8 +1,8 @@
From b55677c051b747ee512d3abb02bd515851dd344b Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Tue, 10 Nov 2026 08:10:32 +0000
Subject: [PATCH] drm/panel: samsung-oneplus-dsc: switch the display on after
the first frame
Subject: [PATCH 25/25] drm/panel: samsung-oneplus-dsc: switch the display on
after the first frame
With the panel initialised by the driver (0019), the on-sequence ended
with display on (0x29), and the panel showed what was in its frame memory
@@ -127,6 +127,3 @@ index a8716caa9..53496ae84 100644
ret = mipi_dsi_detach(dsi);
if (ret < 0)
dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
--
2.53.0
+3 -3
View File
@@ -33,8 +33,8 @@ fi
# runs in parallel with them, and a config change then regenerates
# include/generated/* while sources compile -- the build failed with an empty
# LINUX_VERSION_CODE and an empty KERNEL_REL (2026-11-09)
make -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" olddefconfig
make -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
-j"$(nproc)" "$(basename "$KERNEL_IMAGE")" modules \
kernel_make "$tree" olddefconfig
# the name (uname -r, /proc/version) comes from kernel_make (lib.sh)
kernel_make "$tree" -j"$(nproc)" "$(basename "$KERNEL_IMAGE")" modules \
${KERNEL_DTB:+"$KERNEL_DTB"}
echo "$tree/$KERNEL_IMAGE"
+26
View File
@@ -39,6 +39,32 @@ die() {
exit 1
}
# kernel_make TREE TARGET...: make in a kernel tree with the kernel's name in
# Makronix's versioning, from the files the NetBSD side reads
# (src/sys/conf/newvers.sh, src/etc/Makefile): makronix-release and
# makronix-codename. uname -r is <linux>-makronix, with -unstable while the
# Makronix version is an x.99.y -- NetBSD's convention for -current, not a
# release -- and /proc/version names makronix@<codename>. Every make in the
# tree goes through here: kbuild writes include/config/kernel.release again on
# each call, so a modules_install without the same LOCALVERSION would install
# under another name. kernel.config sets no CONFIG_LOCALVERSION and no
# LOCALVERSION_AUTO; a LOCALVERSION on the command line also keeps
# setlocalversion from appending "+" for the patched tree.
kernel_make() {
_tree=$1
shift
_mx=$ROOT/../src/sys/conf
_mxr=$(cat "$_mx/makronix-release") || die "no $_mx/makronix-release"
_mxn=$(cat "$_mx/makronix-codename") || die "no $_mx/makronix-codename"
case $_mxr in
*.99.*) _lv=-makronix-unstable ;;
*) _lv=-makronix ;;
esac
make -C "$_tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
LOCALVERSION="$_lv" KBUILD_BUILD_USER=makronix \
KBUILD_BUILD_HOST="$(echo "$_mxn" | tr '[:upper:]' '[:lower:]')" "$@"
}
# The running phone over the USB network. phone_addr prints the address
# where ssh answers: PHONE_IP (172.16.42.1) if it does, else the IPv6
# link-local neighbour on the host's cdc_ncm interface -- the host loses its
+1 -1
View File
@@ -48,7 +48,7 @@ trap 'unshare --map-root-user --map-auto rm -rf "$work"' EXIT
# the modules of the kernel in the boot image: same tree, same release
release=$(cat "$tree/include/config/kernel.release")
make -s -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
kernel_make "$tree" -s \
INSTALL_MOD_PATH="$work/modules" INSTALL_MOD_STRIP=1 modules_install
[ -d "$work/modules/lib/modules/$release" ] || die "modules_install wrote no $release"
+1 -1
View File
@@ -31,7 +31,7 @@ mkdir -p "$work"
trap 'unshare --map-root-user --map-auto rm -rf "$work"' EXIT
release=$(cat "$tree/include/config/kernel.release")
make -s -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
kernel_make "$tree" -s \
INSTALL_MOD_PATH="$work/modules" INSTALL_MOD_STRIP=1 modules_install
[ -d "$work/modules/lib/modules/$release" ] || die "modules_install wrote no $release"
+1
Submodule refs/linux/7.0.14 added at 458c6079fc.