Identity
| Part | RK3399 pin controller + GPIO banks |
| Role | Pin mux, pull-up/down, drive strength, schmitt trigger, plus 160 GPIO lines (5 banks x 32 pins) and per-pin interrupt controller |
| Bus / address | GRF MMIO 0xff770000 + PMU GRF 0xff320000 (mux/pull); per-bank GPIO MMIO 0xff720000 (GPIO0), 0xff730000 (GPIO1), 0xff780000 (GPIO2), 0xff788000 (GPIO3), 0xff790000 (GPIO4) |
| GPIO / IRQ | five GIC SPIs (one per bank); each pin individually maskable as level / edge interrupt source |
| Datasheet | RK3399 TRM Part 1 chapters 4 (GRF/pinctrl) and 11 (GPIO) |
| Pine64 wiki | PinePhone Pro main page |
| Schematic | sheet 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
- Our tree:
src/sys/arm64/rockchip/rk_gpio.c— per-bank GPIO controller plus PIC.- Pinctrl proper lives in the FreeBSD upstream Rockchip driver and is consumed unmodified.
- Linux mainline:
drivers/pinctrl/rockchip/anddrivers/gpio/gpio-rockchip.c. - FreeBSD upstream:
sys/arm64/rockchip/rk_pinctrl.candsys/arm64/rockchip/rk_gpio.c.
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
- Audit pull-up/pull-down settings against the schematic for board-specific lines (some upstream Linux DTS values are board-generic and may not match the PPP wiring).
- Confirm GPIO4_D4 (HP detect) is wired and edge-triggered when the headphone-jack policy is implemented.
- Verify that all sensor-bus IRQ allocations now succeed end-to-end after the bus-method passthrough fix; a few drivers still poll instead of using IRQ.
Related
- Goodix and PIC methods — the touchscreen IRQ saga that exercised this driver.
- Cross-driver audit 2026-04-30 — Rockchip driver audit.
- Hardware reference — pin-name conventions.