Rockchip GPIO Number Calculator
Convert between Rockchip pin names (GPIO3_B5), Linux GPIO numbers (109), libgpiod chip/line (gpiochip3 13) and device-tree syntax (&gpio3 RK_PB5). Works for RK3588, RK3576, RK3568, RK3566, RK3399, RK3328, PX30 and RV-series SoCs.
Linux GPIO
109libgpiod
gpioset gpiochip3 13=1Device tree
<&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>pinctrl
rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;sysfs (legacy)
echo 109 > /sys/class/gpio/exportHow the numbering works
Each bank has 32 lines split into ports A–D of 8 pins. Linux number = bank × 32 + port × 8 + pin (A=0, B=1, C=2, D=3). The libgpiod line offset is the same without the bank term. Read the full walkthrough in Configure GPIO on Rockchip.
Some SoCs don't bond out every line, and small parts may have fewer banks. Check your SoC's datasheet and the board schematic. Pin muxing and IO-domain voltage (1.8 V vs 3.3 V) still apply.
Full GPIO number table
GPIO0 gpiochip0
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| A | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| B | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| C | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| D | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
GPIO1 gpiochip1
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| A | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
| B | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
| C | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
| D | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
GPIO2 gpiochip2
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| A | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
| B | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
| C | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
| D | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
GPIO3 gpiochip3
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| A | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
| B | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
| C | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 |
| D | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
GPIO4 gpiochip4
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| A | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
| B | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
| C | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 |
| D | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 |