Skip to content

plastron: the R36S's kernel and device tree, a start - #461

Merged
tarikbc merged 9 commits into
mainfrom
r36s-board
Nov 25, 2026
Merged

tarikbc merged 9 commits into
mainfrom
r36s-board

Conversation

@tarikbc

@tarikbc tarikbc commented Nov 22, 2026

Copy link
Copy Markdown
Owner

The second part of R36S support: its kernel and device tree build. Nothing boots them yet.

  • buildroot/board/r36s/dts/: ROCKNIX's R36S device tree from its 20260901 release (the release the Pixel 2's kernel patches come from), unchanged: rk3326-gameconsole-r36s.dts, rk3326-gameconsole-r3xs.dtsi and rk3326-device-group-r36.dtsi. They are GPL-2.0+ OR MIT, (c) JELOS, and they go on the Pixel 2's rk3326.dtsi. THIRD-PARTY.md lists them.
  • buildroot/board/r36s/linux-r36s.fragment: the Pixel 2's config, plus the ST7703 panel driver. The R36S's default panel (gameconsole,r36s-panel) needs it, and ROCKNIX's panel patch that we already carry has that panel's mode and init sequence. Everything else the R36S needs is already in the Pixel 2's config: the RK817, Panfrost, the singleadc joypad with the sticks' mux, gpio-keys, SARADC, dw_mmc and generic-dsi.
  • scripts/build-r36s-kernel.sh and make r36s-kernel: they apply the Pixel 2's kernel patches to the Linux source a Pixel 2 build downloaded, merge the fragment, and check that each of its lines holds. Then they build Image and rk3326-gameconsole-r36s.dtb with Debian's cross compiler and four jobs, into out/r36s-kernel/.

What I ran: make r36s-kernel. It built a 14 MB Image and a 51 KB dtb. Its config has CONFIG_DRM_PANEL_SITRONIX_ST7703=y. Decompiled, the dtb has the model "Game Console R36S", the gameconsole,r36s-panel ST7703, r36s_Gamepad on rocknix-singleadc-joypad with amux-count = 4, and the volume keys. dtc gives 7 warnings, all from the panel node that ROCKNIX's tree names twice.

Not done: U-Boot (the Pixel 2's carries a PX30S DDR patch, and the R36S is a plain RK3326), an r36s_defconfig and its card, the launcher's device file and Diatom's port, and panel overlays. They are in order in docs/devices/r36s.md (#460).

make r36s-kernel builds the R36S's kernel and device tree: the Pixel 2's
kernel (kernel.org 7.1.2 with the same ROCKNIX patches, which already
carry the R36S's ST7703 panel and its joypad driver), the Pixel 2's
config with board/r36s/linux-r36s.fragment merged in (the ST7703 panel
driver, which the Pixel 2 leaves out), and ROCKNIX's R36S device tree
from its 20260901 release, unchanged, on the Pixel 2's rk3326.dtsi. It
runs in the builder with Debian's cross compiler and four jobs, and
stops if a line of the fragment does not hold.

Nothing boots it yet: there is no R36S card image, U-Boot or launcher
device file. docs/devices/r36s.md lists what is left.
make r36s builds ZyperOS for the R36S in output-r36s and writes
out/r36s-sdcard.img: the Pixel 2's system (configs/r36s_defconfig is
px2_defconfig with the R36S's lines, FLAVOR=r36s merges ZyperOS's config
and board/r36s/r36s.config) with the R36S's kernel config, device trees,
card and launcher (BR2_PLASTRON_DEVICE r36s). On four CPUs.

- Its device tree is ROCKNIX's with the boot card first among the SD
  cards (rk3326-gameconsole-r36s-zyperos.dts): the RK3326 boots from its
  sdmmc controller only, and every script finds the system's card as
  mmcblk0. ROCKNIX's own is beside it on the card. Both are built with
  their symbols, so a panel's overlay can go over them.
- Its boot script is the Pixel 2's with its device tree, the kernel's
  messages on the serial port and on the screen (DRM's log client, in its
  kernel fragment), and r36s-boot.txt on the boot partition, which a
  tester edits on any computer to try ROCKNIX's tree, a panel overlay or
  other kernel arguments. A panel overlay at overlays/mipi-panel.dtbo,
  ROCKNIX's place for one, is laid over the tree when it is there (the
  R36S's own copy of the slots' boot tail, so the Pixel 2's boot script
  stays as it is).
- Its card is the Pixel 2's layout with R36SBOOT for the boot partition,
  and its bootloader is the Pixel 2's U-Boot, the one ROCKNIX builds for
  its RK3326 handhelds, whose PX30S-only part does nothing on a plain
  RK3326. Whether it starts an R36S is the first thing a test card shows.
- No gauge: it has no battery lights.

make r36s-kernel builds the new device tree too, and still checks every
line of the fragment.
tarikbc and others added 7 commits November 23, 2026 10:19
…s boost

ROCKNIX's R36S tree gives the VOP one register range, so the kernel's PX30
gamma LUT (patch 7) has nowhere to go and the display has no GAMMA_LUT.
ZyperOS makes Screen Colors, Night Mode, the two dimmest brightness rungs
and the boost past the top of the brightness with that table, so on the
first R36S that ran it the three boost steps changed nothing (Sylver,
2026-11-23). ZyperOS's R36S tree gives the VOP the LUT's range, as the
Pixel 2's does.
R36S units ship with several panels, and the first test card lit only
after a switch to another panel's device tree. scripts/r36s-panel.py makes
the overlay for a unit's own panel on a computer, from the device tree on
the card it came with: its panel node's init sequence (the Rockchip BSP's
type, delay, length, bytes), its native mode, delays and DSI settings, as
ROCKNIX's generic-dsi driver's panel_description lines, over ZyperOS's
panel (&internal_display). Written from the two formats; it converts each
of the R36S's six known panels' stock trees, and each overlay applies to
the card's device tree (fdtoverlay). The stock trees' 50 and 75 Hz modes
keep the 60 Hz clock, so only the native mode goes in.

r36s-boot.txt's zy_panel=N picks overlays/panel-N.dtbo, so one card can
hold several panels' overlays and a digit picks one.
The card's panel is the overlay, applied over the stock tree, and the boot pictures are the Pixel's turned back to 640x480 so the copy's line and bar appear.
…ee, and none picked by default

r36s-panel.py writes panel-0 to panel-4 and panel-4v22 from the stock
device trees in lcdyk0517/arkos4clone (MIT), each with its .dts beside
it; overlays/README and THIRD-PARTY.md say which comes from which. The
script now reads trees dtc built with labels, takes the mode nearest
60 Hz (panels 3, 4 and 4v22 keep a 60 Hz one beside a 77 Hz native),
and uses the power-up waits and DSI clock flag of the overlay that lit
board R36S-V12's panel 4. Its panel-4 has that overlay's init sequence,
all 155 commands. The card holds all six, and r36s-boot.txt leaves
zy_panel commented: a unit with panel 0 needs none.
…he Pixel 2's, and a check says when they are stale

make-splash-frames.py --r36s reads each first-start picture's bar and
its ground colour from the Pixel 2's file instead of fixed numbers (the
18 files it makes are the same, byte for byte), and writes SOURCES, the
sha256 of each file it read and made. make check-splash-r36s fails when
a Pixel 2 picture changed since, or an R36S one changed or is missing.
@tarikbc
tarikbc marked this pull request as ready for review November 24, 2026 03:01
@tarikbc
tarikbc merged commit c66e2d1 into main Nov 25, 2026
8 checks passed
@tarikbc
tarikbc deleted the r36s-board branch November 25, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants