summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2023-06-19 13:37:23 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2023-06-19 13:37:23 +0000
commitc1b33081a54d433cfdbc06a4768fe950d38d83ef (patch)
tree05b6809fe88ece06a7a4cbd6b93ea6ee52eda45b /sys
parentcf3d7ad102765a8579b2d976211f0e5f84c954c0 (diff)
Fix RK3588 support. Makes dwmmc(4) actually work.
ok patrick@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdt/rkpinctrl.c12
1 files 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 <kettenis@openbsd.org>
*
@@ -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);
}