Appendix · reference

RK3399 pin controller and GPIO

Pin mux, pull, drive strength, and 160 GPIO lines

Identity

PartRK3399 pin controller + GPIO banks
RolePin mux, pull-up/down, drive strength, schmitt trigger, plus 160 GPIO lines (5 banks x 32 pins) and per-pin interrupt controller
Bus / addressGRF MMIO 0xff770000 + PMU GRF 0xff320000 (mux/pull); per-bank GPIO MMIO 0xff720000 (GPIO0), 0xff730000 (GPIO1), 0xff780000 (GPIO2), 0xff788000 (GPIO3), 0xff790000 (GPIO4)
GPIO / IRQfive GIC SPIs (one per bank); each pin individually maskable as level / edge interrupt source
DatasheetRK3399 TRM Part 1 chapters 4 (GRF/pinctrl) and 11 (GPIO)
Pine64 wikiPinePhone Pro main page
Schematicsheet 4 (GPIO bank wiring)

Status — ● working

Pin mux is applied automatically by the FreeBSD pinctrl framework during driver attach via pinctrl-0 references in the device tree — this is how I2C, SPI, UART, I2S, SDIO, and SARADC get their lines. GPIO control surfaces as /dev/gpioc0 through /dev/gpioc4; the notification LEDs, modem power sequencing, BT_REG_ON, WL_REG_ON, and audio amp enable all use it. The PIC (programmable interrupt controller) implementation now passes through child interrupt allocation correctly — the goodix touchscreen IRQ on GPIO3_B5 attached cleanly after 2972362 rk_i2c + goodix: fix iicbus child IRQ alloc added missing bus method passthroughs to rk_i2c, which had been the root cause of several “IRQ won’t allocate” bugs across the iicbus-attached drivers.

Driver

The local rk_gpio.c overlay carries PIC fixes for the goodix and sensor IRQ paths. The pinctrl side is upstream-clean. Our DTs drive a few PinePhone-specific pin groups (modem control GPIOs, BT host wake on GPIO0_PA4, WL_REG_ON on GPIO0_B2) that follow the upstream Linux DTS convention exactly.

Open work