Hi Eugen, On 2023-03-15 16:32, Eugen Hristev wrote: > From: Jianqun Xu <jay...@rock-chips.com> > > Add support for Rockchip rk3588 variant of pinctrl. > > The driver is adapted from the Linux driver. > > Signed-off-by: Jianqun Xu <jay...@rock-chips.com> > [eugen.hris...@collabora.com: > port to latest U-boot, bring more changes from Linux > use translated pull values table] > Signed-off-by: Eugen Hristev <eugen.hris...@collabora.com> > --- > Changes in v4: > - After checking with what happens in Linux, it appears that the gpio4 > D0-D5 also work using VCCIO2, just that the value written by Uboot > appears to be wrongly computed. Linux and other drivers like rk3568 > use a translated pull value. Adapt also the r3588 to use this translated > value. Now the arrays are identical with Linux > > Changes in v3: > - change assert(i) to assert (i >= 0) because i==0 is a valid number it's > the first entry in the array. Otherwise it would assert wrongly when setting > gpio 0 A2 e.g. > > Changes in v2: > - change the way the reg is computed to align with Linux > - For the gpio4 bank D0-8, as the downstream uboot uses VCCIO6 instead of > VCCIO2, change accordingly, otherwise D0-D5 pins won't work to set PUP/PDOWN, > DS, etc. It appears gpio4D has the registers just after gpio4A,gpio4B,gpio4C > in the same VCCIO6, and not in VCCIO2. > > drivers/pinctrl/rockchip/Makefile | 1 + > drivers/pinctrl/rockchip/pinctrl-rk3588.c | 353 ++++++++++++++++++++ > drivers/pinctrl/rockchip/pinctrl-rockchip.h | 187 +++++++++++ > 3 files changed, 541 insertions(+) > create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3588.c >
Tested-by: Jonas Karlman <jo...@kwiboo.se> Reviewed-by: Jonas Karlman <jo...@kwiboo.se> Regards, Jonas