The GMAC on the Rockchip RK356x and RK3588 SoCs can only do 32-bit DMA
authorkettenis <kettenis@openbsd.org>
Wed, 15 Feb 2023 14:13:38 +0000 (14:13 +0000)
committerkettenis <kettenis@openbsd.org>
Wed, 15 Feb 2023 14:13:38 +0000 (14:13 +0000)
so set the appropriate DMA constraint.

ok patrick@

sys/arch/arm64/stand/efiboot/conf.c
sys/arch/arm64/stand/efiboot/efiboot.c

index 627271a..6677db0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: conf.c,v 1.43 2022/12/08 00:29:06 patrick Exp $       */
+/*     $OpenBSD: conf.c,v 1.44 2023/02/15 14:13:38 kettenis Exp $      */
 
 /*
  * Copyright (c) 1996 Michael Shalayeff
@@ -46,7 +46,7 @@
 #include "efipxe.h"
 #include "softraid_arm64.h"
 
-const char version[] = "1.15";
+const char version[] = "1.16";
 int    debug = 0;
 
 struct fs_ops file_system[] = {
index 7629136..c745263 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: efiboot.c,v 1.46 2022/12/08 00:29:06 patrick Exp $    */
+/*     $OpenBSD: efiboot.c,v 1.47 2023/02/15 14:13:38 kettenis Exp $   */
 
 /*
  * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -575,10 +575,18 @@ efi_dma_constraint(void)
                }
        }
 
-       /* Raspberry Pi 4 is "special". */
+       /*
+        * Some SoC's have DMA constraints that aren't explicitly
+        * advertised.
+        */
        node = fdt_find_node("/");
        if (fdt_node_is_compatible(node, "brcm,bcm2711"))
                dma_constraint[1] = htobe64(0x3bffffff);
+       if (fdt_node_is_compatible(node, "rockchip,rk3566") ||
+           fdt_node_is_compatible(node, "rockchip,rk3568") ||
+           fdt_node_is_compatible(node, "rockchip,rk3588") ||
+           fdt_node_is_compatible(node, "rockchip,rk3588s"))
+               dma_constraint[1] = htobe64(0xffffffff);
 
        /* Pass DMA constraint. */
        node = fdt_find_node("/chosen");