Initial: BESser umbrella for BES2600 driver mainlining

Sets up the BES2600 mainlining work tree with:

- README: project overview, hardware target, driver lineage
  (CW1200 -> Bestechnic -> arjan-vlek -> Mobian/danctnix), patch series
  status, repo map, build/deploy workflow.

- patches/: c1 patch generated by git format-patch from
  marfrit/bes2600-dkms branch bes2600/factory-request-firmware
  (checkpatch.pl --no-tree --strict: 0 errors / 0 warnings / 0 checks).

- scripts/: build-bes2600-on-ohm.sh, deploy-c1-to-ohm.sh,
  backup-ohm-kernel.sh - reproducible build + deploy + backup.

- fw-analysis/: per-blob strings.txt + fnnames.txt extracted from the
  4 firmware blobs pulled from ohm 2026-04-21. Source binaries NOT
  committed (Bestechnic-proprietary).

- notes/: observed-bugs.md (4 known bug surfaces with file:line +
  patch-series cross-reference), source-map.md (every public driver
  source variant + their canonical role).

Companion work tree: marfrit/bes2600-dkms (Mobian DKMS fork) at
git.reauktion.de.

Signed-off-by: Markus Fritsche <fritsche.markus@gmail.com>
This commit is contained in:
2026-04-22 10:13:23 +02:00
commit e580126d84
16 changed files with 5171 additions and 0 deletions
+118
View File
@@ -0,0 +1,118 @@
# BESser — BES2600 driver mainlining for Pine64 PineTab2
Working tree for upstreaming the **Bestechnic BES2600WM WiFi/BT combo**
driver currently shipped out-of-tree by the danctnix kernel for the
Pine64 PineTab2.
## Why "BESser"
"BES" (the chip vendor) + German *besser* ("better"). Sibling to:
- **Bin** — u-boot upstreaming for the CoolPi GenBook (RK3588)
- **MegabitChip** — DDR init blob RE for the same SoC
- **SouthAfrica** — OpenPineBuds / 1MORE Fit SE BES2300 firmware RE (chip family relative)
- **RockHard** — RK3588 mainline kernel work
## Hardware target
| Item | Value |
|------|-------|
| Device | PineTab2 |
| Host name | `ohm` (`ohm.fritz.box`, `ohm.vpn = 10.170.16.14`) |
| SoC | Rockchip RK3566 (aarch64) |
| WiFi/BT | **Bestechnic BES2600WM** — WiFi 4 (11n dual-band 1x1) + BT 5.2/5.3 |
| WiFi interface | SDIO 3.0, vendor `0xBE57` device `0x2002` |
| BT interface | UART HCI (separate `bes2600_btuart` module) |
| OS | Arch Linux ARM, danctnix kernel `6.19.10-danctnix1-1-pinetab2` |
## Driver lineage
```
ST-Ericsson CW1200 (mainline drivers/net/wireless/st/cw1200/)
│ author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Bestechnic BES2600 (closed fork ~20152023, same author)
│ adds: BT-over-UART, 5GHz, ePTA coexistence, SDIO ADMA, char-dev API
Released for Chinese Android burner-phone vendor kernels (~2023)
arjan-vlek/bes2600 (GitLab, 2023-07) → 26-commit checkpatch cleanup
├── TuxThePenguin0/bes2600 (preserves pre-removal Android source)
├── salsa.debian.org/Mobian-team/devices/bes2600-dkms (active, our PR target)
└── codeberg.org/DanctNIX/linux-pinetab2 (in-kernel at drivers/staging/bes2600/)
```
CW1200-ancestry markers in current source: same author Dmitry Tarnyagin,
`CONFIG_BES2600_USE_STE_EXTENSIONS` (STE = ST-Ericsson),
`CONFIG_BES2600_WSM_DEBUG` (WSM = CW1200's host↔FW protocol).
## Repos
| Role | Path |
|------|------|
| **This umbrella** | `git.reauktion.de/marfrit/besser` — patches/, scripts/, fw-analysis/, notes/ |
| **Mobian DKMS fork** (PR target) | `git.reauktion.de/marfrit/bes2600-dkms` — branches per patch; upstream = `salsa.debian.org/Mobian-team/devices/bes2600-dkms` |
## Patch series
| Patch | Status | Description |
|-------|--------|-------------|
| **c1** | ✅ MERGED-LOCAL, deployed on ohm | `bes2600: use request_firmware() for factory.txt read` — kills filp_open / kernel_read in the read path; fixes the `(NULL device *) read and check /lib/firmware/bes2600_factory.txt error` boot spam |
| **c2** | pending | PM handshake gate + retry — fixes `bes2600_pwr_enter_lp_mode wait pm ind timeout` recurring every 510s |
| **c3** | pending | bes_chardev removal + nl80211 testmode hookup — clears the second upstream blocker (custom char device); secondary effect on bug #3 |
| **c4** | pending | Enable `CONFIG_BES2600_TESTMODE=y` + route `patch_wifi_testMode` — exposes hidden firmware testmode features |
| **c5** | pending | Investigate `factory.txt parse fail` — uncovered by c1; original bug masked it; parser chokes on data request_firmware now successfully returns |
| c1.1 | pending follow-up | Drop `kernel_write` from factory.c + bes_chardev.c + bes_fw.c (`/lib/firmware/bes2002_fw_write.bin` debug file!) |
| c1.2 | pending follow-up | Thread `struct device *` through factory API → eliminates `(NULL device *)` log prefix |
## Workflow
1. Edit on Mobian fork (`bes2600-dkms`) — primary upstream PR target
2. Topic branch per patch: `bes2600/<short-name>`
3. `git commit --signoff` with full kernel-style message
4. checkpatch.pl --no-tree --strict before push (must be clean)
5. `git format-patch -1 -o ../besser/patches/` to canonicalize
6. Push branch to `origin` (Gitea), open MR upstream when ready
## Build + deploy
See `scripts/`:
- `build-bes2600-on-ohm.sh` — native aarch64 build on ohm (requires `linux-pinetab2-headers`)
- `deploy-c1-to-ohm.sh` — install patched modules to `/lib/modules/<ver>/extra/` + depmod
- `backup-ohm-kernel.sh` — timestamped tar.zst of /boot + /lib/modules + /lib/firmware/bes2600
## Firmware RE state (task d)
Firmware blobs (4 .bin + factory.txt) are **not** committed here (binary,
ships from Bestechnic). On `boltzmann:~/src/besser/firmware-from-ohm/` and
on `oppenheimer:/work/besser/` (Ghidra host).
What IS committed under `fw-analysis/`:
- `*.strings.txt` — full sorted-unique strings extraction per blob
- `*.fnnames.txt` — function-name pattern extraction (191 candidates from `best2002_fw_sdio.bin`)
Build provenance: Dec 26-27 2023 build from Bestechnic Jenkins
(`GCC-10-pipeline`), source git commit `8125e20be` (NOT public).
Hidden features in firmware (per task d): testmode patch (CONFIG_BES2600_TESTMODE
gates it), ePTA coexistence with bypass (`gEptaBypass: %d`), DPD per-channel
calibration, hal_trace_crash_dump_register, METAL_ID + patch_version
introspection, RF tone generation (nosignal variant), memory dump (nosignal
variant), DAC/IQ calibration v2, fast-PSM tuning hooks.
## Adjacent infrastructure
- **oppenheimer** (CT131 on data Proxmox): Ghidra 11.3.2 host. SSH via
`mfritsche@192.168.88.63`. Staging at `/work/besser/`.
- **boltzmann** (Rock 5 ITX+): primary build/dev, ARM64 native, hub-tools
preferred path.
- **ohm**: target hardware; UART-over-USB-C debug rig also available
(Tigard FT2232H Channel A @ 1.8V).
## Authors / contacts
- Markus Fritsche `<fritsche.markus@gmail.com>` (this fork)
- Driver upstream: Dmitry Tarnyagin `<dmitry.tarnyagin@stericsson.com>` (CW1200 / BES2600 base)
- BT companion: Dang Huynh `<dang.huynh@mainlining.org>` (`bes2600_btuart.c`, 2025)
- Mobian DKMS: Julian `<mail@julianfairfax.ch>` (current packaging maintainer)