git: 9142f3a8852c - main - Fix a rk356x pinctrl register offset
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 11 Nov 2022 08:50:40 UTC
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=9142f3a8852c2e75ebf8cf227c85a005a017eaae
commit 9142f3a8852c2e75ebf8cf227c85a005a017eaae
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-11-11 08:25:57 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-11-11 08:34:48 +0000
Fix a rk356x pinctrl register offset
The pull-up/pull-down register offset was wrong on the Rockchip rk356x.
It was set such that the driver would modify the IOMUX control registers.
This seems to work with the current device tree files, but fails with
upstream files. Fix the offset so the later calculation has the correct
offset for the pull-up/pull-down control register.
Sponsored by: The FreeBSD Foundation
---
sys/arm64/rockchip/rk_pinctrl.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c
index c158de40dca5..db002927fc9c 100644
--- a/sys/arm64/rockchip/rk_pinctrl.c
+++ b/sys/arm64/rockchip/rk_pinctrl.c
@@ -929,7 +929,14 @@ static uint32_t
rk3568_get_pd_offset(struct rk_pinctrl_softc *sc, uint32_t bank)
{
- return (0);
+ if (bank == 0)
+ return (0x20);
+
+ /*
+ * Registers start at 0x80, but bank index starts at 1. Return 0x70
+ * so later calculations get the correct offset.
+ */
+ return (0x70);
}
static struct syscon *