git: 355cb40c3a87 - main - Set RK3568 specific pin mux for GMAC1.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 28 Dec 2022 03:01:17 UTC
The branch main has been updated by ganbold:
URL: https://cgit.FreeBSD.org/src/commit/?id=355cb40c3a87e80b04b0cce15f4bad9337995ad1
commit 355cb40c3a87e80b04b0cce15f4bad9337995ad1
Author: Søren Schmidt <sos@FreeBSD.org>
AuthorDate: 2022-12-28 03:00:19 +0000
Commit: Ganbold Tsagaankhuu <ganbold@FreeBSD.org>
CommitDate: 2022-12-28 03:00:19 +0000
Set RK3568 specific pin mux for GMAC1.
---
sys/arm64/rockchip/rk_pinctrl.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c
index db002927fc9c..2e1fe5f41bb4 100644
--- a/sys/arm64/rockchip/rk_pinctrl.c
+++ b/sys/arm64/rockchip/rk_pinctrl.c
@@ -767,6 +767,10 @@ struct rk_pinctrl_conf rk3399_conf = {
.get_bias_value = rk3399_get_bias_value,
};
+#define GRF_IOFUNC_SEL0 0x0300
+#define GMAC1_IOMUX_SEL_M0 0x01000000
+#define GMAC1_IOMUX_SEL_M1 0x01000100
+
static struct rk_pinctrl_gpio rk3568_gpio_bank[] = {
RK_GPIO(0, "gpio0"),
RK_GPIO(1, "gpio1"),
@@ -1239,6 +1243,17 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, uint32_t *pindata)
* without hi-word write mask.
*/
SYSCON_MODIFY_4(syscon, reg, mask, function << bit | (mask << 16));
+
+ /* RK3568 specific pin mux for various functionalities */
+ if (ofw_bus_node_is_compatible(ofw_bus_get_node(sc->dev),
+ "rockchip,rk3568-pinctrl")) {
+ if (bank == 3 && pin == 9 && function == 3)
+ SYSCON_WRITE_4(sc->grf,
+ GRF_IOFUNC_SEL0, GMAC1_IOMUX_SEL_M0);
+ if (bank == 4 && pin == 7 && function == 3)
+ SYSCON_WRITE_4(sc->grf,
+ GRF_IOFUNC_SEL0, GMAC1_IOMUX_SEL_M1);
+ }
}
static int