From 3ad34a14306c1b115366520f61c56832c3d54fb8 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 19 Jun 2023 13:37:22 +0000 Subject: [PATCH] Fix RK3588 support. Makes dwmmc(4) actually work. ok patrick@ --- sys/dev/fdt/rkpinctrl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/fdt/rkpinctrl.c b/sys/dev/fdt/rkpinctrl.c index b98a88d486d..36db072a32c 100644 --- a/sys/dev/fdt/rkpinctrl.c +++ b/sys/dev/fdt/rkpinctrl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkpinctrl.c,v 1.11 2023/03/04 22:51:12 kettenis Exp $ */ +/* $OpenBSD: rkpinctrl.c,v 1.12 2023/06/19 13:37:22 kettenis Exp $ */ /* * Copyright (c) 2017, 2018 Mark Kettenis * @@ -1174,9 +1174,9 @@ rk3588_pinctrl(uint32_t phandle, void *cookie) bank = pins[i]; idx = pins[i + 1]; mux = pins[i + 2]; - pull = rk3568_pull(bank, idx, pins[i + 3]); - strength = rk3568_strength(bank, idx, pins[i + 3]); - schmitt = rk3568_schmitt(bank, idx, pins[i + 3]); + pull = rk3588_pull(bank, idx, pins[i + 3]); + strength = rk3588_strength(bank, idx, pins[i + 3]); + schmitt = rk3588_schmitt(bank, idx, pins[i + 3]); if (bank > 5 || idx > 32 || mux > 15) continue; @@ -1237,7 +1237,7 @@ rk3588_pinctrl(uint32_t phandle, void *cookie) if (strength >= 0) { off = bank * 0x20 + (idx / 4) * 0x04; mask = (0xf << ((idx % 4) * 4)); - bits = ((1 << (strength + 1)) - 1) << ((idx % 4) * 4); + bits = (strength << ((idx % 4) * 4)); regmap_write_4(rm, ds_base + off, mask << 16 | bits); } @@ -1245,7 +1245,7 @@ rk3588_pinctrl(uint32_t phandle, void *cookie) if (schmitt >= 0) { off = bank * 0x10 + (idx / 8) * 0x04; mask = (0x1 << (idx % 8)); - bits = schmitt << (idx % 8); + bits = (schmitt << (idx % 8)); regmap_write_4(rm, smt_base + off, mask << 16 | bits); } -- 2.20.1