From 2bc3fe809bf5ea00e6a4151f6ae3e9153f1d6d7c Mon Sep 17 00:00:00 2001 From: kettenis Date: Wed, 15 Feb 2023 14:13:38 +0000 Subject: [PATCH] The GMAC on the Rockchip RK356x and RK3588 SoCs can only do 32-bit DMA so set the appropriate DMA constraint. ok patrick@ --- sys/arch/arm64/stand/efiboot/conf.c | 4 ++-- sys/arch/arm64/stand/efiboot/efiboot.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/arch/arm64/stand/efiboot/conf.c b/sys/arch/arm64/stand/efiboot/conf.c index 627271abf24..6677db033c6 100644 --- a/sys/arch/arm64/stand/efiboot/conf.c +++ b/sys/arch/arm64/stand/efiboot/conf.c @@ -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[] = { diff --git a/sys/arch/arm64/stand/efiboot/efiboot.c b/sys/arch/arm64/stand/efiboot/efiboot.c index 7629136f2ff..c74526320f6 100644 --- a/sys/arch/arm64/stand/efiboot/efiboot.c +++ b/sys/arch/arm64/stand/efiboot/efiboot.c @@ -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 @@ -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"); -- 2.20.1