Files
bananarchy/patches/kernel/0002-msm8905-nokia-beatles-and-coconut-dts.patch
T
Luxferre ab53423e33 Port Nokia 800 Tough (nokia-coconut), fix microSD detection, and stage upcoming a1120 (cocojamboo) build
- Migrate nokia-tough to canonical nokia-coconut while keeping CLI aliases, add layered bootloader/lk2nd/nokia-coconut.patch, bootfs/bootimg validators, and offline scripts/inspect-stock-msm8905-dump.py

- Complete nokia-coconut Stage 2 hardware bring-up: wire 6-column 22-key keypad (gpio0, gpio3, gpio7, gpio99, gpio6, gpio1), gpio98 KEY_POWER, and pon@800:resin KEY_DOWN (0x6c); split leds-msm8905-torch into GPIO_13 white:torch (dedicated top-edge flashlight) and GPIO_32 camera:flash (rear camera flash for camera.so and bananarchy-photo)

- Restore sdhci@7864000 non-removable across all six DTS/DTB targets, remove unwired gpio38 cd-gpios/sdc2-cd-* states, and harden sxmo_sdcard.sh under flock

- Register upcoming build a1120 (cocojamboo) in scripts/version.sh, scripts/check-rebuild.sh, CHANGELOG.md, AGENTS.md, README.md, and MANUAL.md with verified hashes across nokia-argon, nokia-beatles, and nokia-coconut
2026-11-15 18:00:10 +02:00

349 lines
12 KiB
Diff

# Bananarchy device tree derivation: nokia-beatles and nokia-coconut start
# from the mainline qcom-msm8905-nokia-argon.dts. This patch is documentation
# of that derivation; the DTBs in images/ are compiled directly from the
# devices/*/qcom-*.dts files by scripts/build-kernel-audio.sh.
--- a/devices/nokia-argon/qcom-msm8905-nokia-argon.dts
+++ b/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts
@@ -4,10 +4,20 @@
#address-cells = <0x01>;
#size-cells = <0x01>;
interrupt-parent = <0x01>;
- model = "Nokia 8110 4G";
- compatible = "nokia,argon", "qcom,msm8905", "qcom,msm8909";
+ model = "Nokia 2720 Flip";
+ compatible = "nokia,beatles", "nokia,argon", "qcom,msm8905", "qcom,msm8909";
chassis-type = "handset";
+ /* Qualcomm aboot selects an appended DTB by these IDs. All three values
+ * are copied verbatim from the MSM8905 QRD SKUB DTB (index 33) in the
+ * stock 2720 recovery image. Keep only that exact board-id pair: older
+ * aboot revisions inspect the first pair only, so adding lk2nd's
+ * 0x0b/0x100 variant makes the DTB look like a different board and the
+ * bootloader never jumps to the kernel. */
+ qcom,msm-id = <0x14b 0x00>;
+ qcom,board-id = <0x1000b 0x100>;
+ qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;
+
aliases {
mmc0 = "/soc@0/sdhci@7824000";
mmc1 = "/soc@0/sdhci@7864000";
@@ -195,9 +205,13 @@
};
};
+ /* Stock aboot rewrites /memory:reg from the SMEM RAM partition table.
+ * Keep the mainline node name (libfdt resolves /memory to it) but ship the
+ * real 512 MiB size as a fallback, so a bootloader that fails to patch the
+ * node still gives Linux usable RAM instead of a zero-sized memory bank. */
memory@80000000 {
device_type = "memory";
- reg = <0x80000000 0x00>;
+ reg = <0x80000000 0x20000000>;
};
pmu {
@@ -1016,7 +1030,7 @@
};
matrix-keypad-col-default-state {
- pins = "gpio52", "gpio56", "gpio7", "gpio99", "gpio6";
+ pins = "gpio52", "gpio56", "gpio7", "gpio99", "gpio6", "gpio1";
function = "gpio";
drive-strength = <0x02>;
bias-disable;
@@ -1030,6 +1044,17 @@
bias-pull-down;
phandle = <0x6e>;
};
+
+ /* External (cover) panel: TE gpio21, reset gpio23,
+ * SPI bus switch gpio13. Used by the cover-panel.dtsi
+ * fragment and by bananarchy-coverd's spidev backend. */
+ cover-panel-gpios-default-state {
+ pins = "gpio21", "gpio23", "gpio13";
+ function = "gpio";
+ drive-strength = <0x02>;
+ bias-pull-down;
+ phandle = <0x92>;
+ };
};
clock-controller@1800000 {
@@ -1150,7 +1175,7 @@
debounce = <0x3d09>;
bias-pull-up;
status = "okay";
- linux,code = <0x6c>;
+ linux,code = <0x72>; /* KEY_VOLUMEDOWN */
};
watchdog {
@@ -1838,7 +1863,7 @@
status = "okay";
display@0 {
- compatible = "nokia,argon-gc9305-v2-panel", "panel-mipi-dbi-spi";
+ compatible = "nokia,beatles-gc9305-panel", "nokia,argon-gc9305-v2-panel", "panel-mipi-dbi-spi";
reg = <0x00>;
backlight = <0x6b>;
reset-gpios = <0x27 0x19 0x00>;
@@ -1886,6 +1911,15 @@
clock-frequency = "", "#(";
};
};
+
+ /* External (cover) GC9305 shares the QUP5 SPI lines.
+ * bananarchy-coverd drives gpio13 to route them to the cover
+ * panel, then talks to it through /dev/spidev0.1. spi-qup
+ * has 4 native chip selects and toggles the single physical
+ * CS line, so reg=1 gives the daemon a second logical device. */
+ spidev@1 {
+ compatible = "rohm,dh2228fv";
+ reg = <0x01>;
+ spi-max-frequency = <0x2faf080>;
+ status = "okay";
+ };
};
@@ -2287,30 +2312,36 @@
pinctrl-0 = <0x86 0x87>;
pinctrl-names = "default";
- key-up {
+ /* gpio90 is the side volume-up rocker on the 2720 Flip. */
+ key-volup {
wakeup-source;
gpios = <0x27 0x5a 0x01>;
- linux,code = <0x67>;
+ linux,code = <0x73>; /* KEY_VOLUMEUP -> XF86AudioRaiseVolume */
debounce-interval = <0x0f>;
linux,can-disable;
};
- key-back {
+ /* gpio98 is the red end/power key. */
+ key-end {
wakeup-source;
gpios = <0x27 0x62 0x01>;
- linux,code = <0x0e>;
+ linux,code = <0x74>; /* KEY_POWER -> XF86PowerOff */
debounce-interval = <0x0f>;
linux,can-disable;
};
- switch-lid-close {
+ /* gpio92: closed-lid hall sensor (EV_SW SW_LID = 1). */
+ hall-lid-closed {
wakeup-source;
gpios = <0x27 0x5c 0x01>;
linux,input-type = <0x05>;
linux,code = <0x00>;
};
- switch-lid-open {
+ /* gpio36: open-lid hall sensor (EV_SW SW_KEYPAD_SLIDE = 1),
+ * also wired to the internal/external panel SPI switch. */
+ hall-lid-open {
+ wakeup-source;
gpios = <0x27 0x24 0x01>;
linux,input-type = <0x05>;
linux,code = <0x0a>;
@@ -2325,8 +2356,36 @@
pinctrl-0 = <0x88 0x89>;
pinctrl-names = "default";
row-gpios = <0x27 0x61 0x01 0x27 0x60 0x01 0x27 0x5f 0x01 0x27 0x5e 0x01>;
- col-gpios = <0x27 0x34 0x01 0x27 0x38 0x01 0x27 0x07 0x01 0x27 0x63 0x01 0x27 0x06 0x01>;
- linux,keymap = <0x1bd 0x10002 0x20005 0x30008 0x4020a 0x1000069 0x1010003 0x1020006 0x1030009 0x104000b 0x20002b8 0x2010004 0x2020007 0x203000a 0x204020b 0x300001c 0x301006a 0x30202b9>;
+ col-gpios = <0x27 0x34 0x01 0x27 0x38 0x01 0x27 0x07 0x01 0x27 0x63 0x01 0x27 0x06 0x01 0x27 0x01 0x01>;
+ /* Physical matrix from the KaiOS downstream DTS (4 rows x 6 cols),
+ * mapped to the canonical keycodes Bananarchy's X11 stack binds:
+ * soft left -> KEY_COMPOSE (XKB 135, XK_Menu), soft right -> KEY_BACK
+ * (XKB 166, XF86Back), center -> KEY_ENTER, call -> KEY_PICKUP_PHONE.
+ * See X_KEYPAD_MAPPING.md and NOKIA-2720-FLIP.md. */
+ linux,keymap = <
+ 0x1bd /* (0,0) call KEY_PICKUP_PHONE */
+ 0x10002 /* (0,1) 1 */
+ 0x20005 /* (0,2) 4 */
+ 0x30008 /* (0,3) 7 */
+ 0x4020a /* (0,4) * KEY_NUMERIC_STAR */
+ 0x500d4 /* (0,5) extra KEY_CAMERA -> XF86WebCam */
+ 0x1000069 /* (1,0) D-pad left KEY_LEFT */
+ 0x1010003 /* (1,1) 2 */
+ 0x1020006 /* (1,2) 5 */
+ 0x1030009 /* (1,3) 8 */
+ 0x104000b /* (1,4) 0 */
+ 0x105000e /* (1,5) clear KEY_BACKSPACE */
+ 0x200007f /* (2,0) soft left KEY_COMPOSE -> XK_Menu */
+ 0x2010004 /* (2,1) 3 */
+ 0x2020007 /* (2,2) 6 */
+ 0x203000a /* (2,3) 9 */
+ 0x204020b /* (2,4) # KEY_NUMERIC_POUND */
+ 0x300001c /* (3,0) D-pad OK KEY_ENTER -> Return */
+ 0x301006a /* (3,1) D-pad right KEY_RIGHT */
+ 0x302009e /* (3,2) soft right KEY_BACK -> XF86Back */
+ 0x3030067 /* (3,3) D-pad up KEY_UP */
+ 0x304006c /* (3,4) D-pad down KEY_DOWN */
+ >;
};
leds {
--- a/devices/nokia-argon/qcom-msm8905-nokia-argon.dts
+++ b/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts
@@ -4,9 +4,18 @@
#address-cells = <0x01>;
#size-cells = <0x01>;
interrupt-parent = <0x01>;
- model = "Nokia 8110 4G";
- compatible = "nokia,argon", "qcom,msm8905", "qcom,msm8909";
+ model = "Nokia 800 Tough";
+ compatible = "nokia,coconut", "nokia,argon", "qcom,msm8905", "qcom,msm8909";
chassis-type = "handset";
+
+ /* Stock MSM8905 QRD SKUB identifiers from Nokia 800 Tough firmware so
+ * lk2nd and stock aboot match the appended DTB reliably. */
+ qcom,msm-id = <0x14b 0x00>;
+ qcom,board-id = <0x1000b 0x100>;
+ qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;
aliases {
@@ -216,7 +219,9 @@
memory@80000000 {
device_type = "memory";
- reg = <0x80000000 0x00>;
+ /* Ship the 512 MiB fallback alongside SMEM patching. */
+ reg = <0x80000000 0x20000000>;
};
pmu {
@@ -1056,34 +1059,28 @@
};
gpio-key-active-state {
- pins = "gpio90", "gpio98";
+ pins = "gpio98";
function = "gpio";
drive-strength = <0x02>;
bias-pull-up;
phandle = <0x86>;
};
- lid-switch-active-state {
- pins = "gpio36", "gpio92";
- function = "gpio";
- drive-strength = <0x06>;
- bias-pull-up;
- phandle = <0x87>;
- };
-
matrix-keypad-row-gpio-state {
pins = "gpio94", "gpio95", "gpio96", "gpio97";
function = "gpio";
drive-strength = <0x02>;
bias-pull-up;
phandle = <0x88>;
};
matrix-keypad-col-default-state {
- pins = "gpio52", "gpio56", "gpio7", "gpio99", "gpio6";
+ pins = "gpio0", "gpio3", "gpio7", "gpio99", "gpio6", "gpio1";
function = "gpio";
drive-strength = <0x02>;
bias-disable;
phandle = <0x89>;
};
+ /* Note: pon@800:resin inherits KEY_DOWN (0x6c) from argon for D-pad Down. */
@@ -1905,7 +1900,7 @@
status = "okay";
display@0 {
- compatible = "nokia,argon-gc9305-v2-panel", "panel-mipi-dbi-spi";
+ compatible = "nokia,coconut-gc9305-panel", "nokia,argon-gc9305-v2-panel", "panel-mipi-dbi-spi";
reg = <0x00>;
backlight = <0x6b>;
reset-gpios = <0x27 0x19 0x00>;
@@ -2348,8 +2343,8 @@
compatible = "simple-battery";
voltage-min-design-microvolt = <0x33e140>;
voltage-max-design-microvolt = <0x432380>;
- energy-full-design-microwatt-hours = <0x594390>;
- charge-full-design-microamp-hours = <0x16e360>;
+ energy-full-design-microwatt-hours = <0x79c3e0>; /* 2,100 mAh battery */
+ charge-full-design-microamp-hours = <0x200b20>;
ocv-capacity-celsius = <0x19>;
ocv-capacity-table-0 = <0x42d560 0x64 0x417da0 0x5f 0x409b10 0x5a 0x3fef30 0x55 0x3f7230 0x50 0x3ef148 0x4b 0x3e6890 0x46 0x3da540 0x41 0x3cda20 0x3c 0x3c45b0 0x37 0x3be408 0x32 0x3b3440 0x2d 0x3a9800 0x28 0x39fbc0 0x23 0x39bd40 0x1e 0x396368 0x19 0x391d18 0x14 0x38cb10 0x10 0x387cf0 0x0d 0x384e10 0x0b 0x384640 0x0a 0x384258 0x09 0x383a88 0x08 0x3832b8 0x07 0x381b48 0x06 0x37c940 0x05 0x371d60 0x04 0x363ad0 0x03 0x34d370 0x02 0x32b090 0x01 0x2dc6c0 0x00>;
phandle = <0x29>;
@@ -2357,7 +2352,7 @@
gpio-keys {
compatible = "gpio-keys";
- pinctrl-0 = <0x86 0x87>;
+ pinctrl-0 = <0x86>;
pinctrl-names = "default";
key-up {
@@ -2368,26 +2363,13 @@
linux,can-disable;
};
- key-back {
+ /* gpio98 is the red end/power key. */
+ key-end {
wakeup-source;
gpios = <0x27 0x62 0x01>;
- linux,code = <0x0e>;
+ linux,code = <0x74>; /* KEY_POWER -> XF86PowerOff */
debounce-interval = <0x0f>;
linux,can-disable;
};
-
- switch-lid-close {
- wakeup-source;
- gpios = <0x27 0x5c 0x01>;
- linux,input-type = <0x05>;
- linux,code = <0x00>;
- };
-
- switch-lid-open {
- gpios = <0x27 0x24 0x01>;
- linux,input-type = <0x05>;
- linux,code = <0x0a>;
- };
};
keypad {
@@ -2398,8 +2380,35 @@
pinctrl-0 = <0x88 0x89>;
pinctrl-names = "default";
row-gpios = <0x27 0x61 0x01 0x27 0x60 0x01 0x27 0x5f 0x01 0x27 0x5e 0x01>;
- col-gpios = <0x27 0x34 0x01 0x27 0x38 0x01 0x27 0x07 0x01 0x27 0x63 0x01 0x27 0x06 0x01>;
- linux,keymap = <0x1bd 0x10002 0x20005 0x30008 0x4020a 0x1000069 0x1010003 0x1020006 0x1030009 0x104000b 0x20002b8 0x2010004 0x2020007 0x203000a 0x204020b 0x300001c 0x301006a 0x30202b9>;
+ col-gpios = <0x27 0x00 0x01 0x27 0x03 0x01 0x27 0x07 0x01 0x27 0x63 0x01 0x27 0x06 0x01 0x27 0x01 0x01>;
+ /* Physical matrix from the Nokia 800 Tough downstream DTS (4 rows x 6 cols).
+ * See X_KEYPAD_MAPPING.md for the canonical keycodes. */
+ linux,keymap = <
+ 0x1bd /* (0,0) call KEY_PICKUP_PHONE */
+ 0x10002 /* (0,1) 1 */
+ 0x20005 /* (0,2) 4 */
+ 0x30008 /* (0,3) 7 */
+ 0x4020a /* (0,4) * KEY_NUMERIC_STAR */
+ 0x500d4 /* (0,5) camera KEY_CAMERA -> XF86WebCam */
+ 0x1000069 /* (1,0) D-pad left KEY_LEFT */
+ 0x1010003 /* (1,1) 2 */
+ 0x1020006 /* (1,2) 5 */
+ 0x1030009 /* (1,3) 8 */
+ 0x104000b /* (1,4) 0 */
+ 0x105000e /* (1,5) clear KEY_BACKSPACE */
+ 0x200007f /* (2,0) soft left KEY_COMPOSE -> XK_Menu */
+ 0x2010004 /* (2,1) 3 */
+ 0x2020007 /* (2,2) 6 */
+ 0x203000a /* (2,3) 9 */
+ 0x204020b /* (2,4) # KEY_NUMERIC_POUND */
+ 0x300001c /* (3,0) D-pad OK KEY_ENTER -> Return */
+ 0x301006a /* (3,1) D-pad right KEY_RIGHT */
+ 0x302009e /* (3,2) soft right KEY_BACK -> XF86Back */
+ 0x3030067 /* (3,3) D-pad up KEY_UP */
+ 0x304006c /* (3,4) D-pad down KEY_DOWN */
+ >;
};