From 0178a63ffe5fc60d0dc4721d407f862679981611 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Tue, 27 Aug 2019 18:00:01 +0000 Subject: [PATCH] arm64: rk3399: pinctrl: Add gpio banks and fix iomux Since r351187 the pinctrl driver need to know the gpio bank as it directly attach the gpio driver to handle some setup that might be present in the dts, add the gpio banks table for rk3399. While here fix some IOMUX definition that prevented to boot on RK3399 as pinctrl wasn't configured correctly. Submitted by: mmel (original version) MFC after: 2 weeks MFC With: r351187 --- sys/arm64/rockchip/rk_pinctrl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c index ae9156bb4c46..f46543194844 100644 --- a/sys/arm64/rockchip/rk_pinctrl.c +++ b/sys/arm64/rockchip/rk_pinctrl.c @@ -527,6 +527,14 @@ struct rk_pinctrl_conf rk3328_conf = { .get_syscon = rk3328_get_syscon, }; +static struct rk_pinctrl_gpio rk3399_gpio_bank[] = { + RK_GPIO(0, "gpio0"), + RK_GPIO(1, "gpio1"), + RK_GPIO(2, "gpio2"), + RK_GPIO(3, "gpio3"), + RK_GPIO(4, "gpio4"), +}; + static struct rk_pinctrl_bank rk3399_iomux_bank[] = { /* bank sub offs nbits */ RK_IOMUX(0, 0, 0x0000, 2), @@ -536,7 +544,7 @@ static struct rk_pinctrl_bank rk3399_iomux_bank[] = { RK_IOMUX(1, 0, 0x0010, 2), RK_IOMUX(1, 1, 0x0014, 2), RK_IOMUX(1, 2, 0x0018, 2), - RK_IOMUX(1, 3, 0x000C, 2), + RK_IOMUX(1, 3, 0x001C, 2), RK_IOMUX(2, 0, 0xE000, 2), RK_IOMUX(2, 1, 0xE004, 2), RK_IOMUX(2, 2, 0xE008, 2), @@ -617,6 +625,8 @@ struct rk_pinctrl_conf rk3399_conf = { .npin_fixup = nitems(rk3399_pin_fixup), .pin_drive = rk3399_pin_drive, .npin_drive = nitems(rk3399_pin_drive), + .gpio_bank = rk3399_gpio_bank, + .ngpio_bank = nitems(rk3399_gpio_bank), .get_pd_offset = rk3399_get_pd_offset, .get_syscon = rk3399_get_syscon, };