From patchwork Wed Dec 4 03:21:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 1203967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47SPKy05nNz9sPh for ; Wed, 4 Dec 2019 14:22:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47SPKx4403zDqSL for ; Wed, 4 Dec 2019 14:22:29 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.ru (client-ip=107.174.27.60; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from ozlabs.ru (unknown [107.174.27.60]) by lists.ozlabs.org (Postfix) with ESMTP id 47SPKl2HF2zDqT7 for ; Wed, 4 Dec 2019 14:22:19 +1100 (AEDT) Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id DBBCBAE80570; Tue, 3 Dec 2019 22:20:44 -0500 (EST) From: Alexey Kardashevskiy To: slof@lists.ozlabs.org Date: Wed, 4 Dec 2019 14:21:37 +1100 Message-Id: <20191204032138.127624-5-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191204032138.127624-1-aik@ozlabs.ru> References: <20191204032138.127624-1-aik@ozlabs.ru> Subject: [SLOF] [PATCH slof v4 4/5] dma: Define default dma methods for using by client/package instances X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" They call parent node (which is a device) methods. Signed-off-by: Michael Roth Signed-off-by: Alexey Kardashevskiy --- board-qemu/slof/Makefile | 1 + board-qemu/slof/OF.fs | 3 +++ slof/fs/dma-instance-function.fs | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 slof/fs/dma-instance-function.fs diff --git a/board-qemu/slof/Makefile b/board-qemu/slof/Makefile index 2263e751bde9..d7ed2d7a6f18 100644 --- a/board-qemu/slof/Makefile +++ b/board-qemu/slof/Makefile @@ -99,6 +99,7 @@ OF_FFS_FILES = \ $(SLOFCMNDIR)/fs/graphics.fs \ $(SLOFCMNDIR)/fs/generic-disk.fs \ $(SLOFCMNDIR)/fs/dma-function.fs \ + $(SLOFCMNDIR)/fs/dma-instance-function.fs \ $(SLOFCMNDIR)/fs/pci-device.fs \ $(SLOFCMNDIR)/fs/pci-bridge.fs \ $(SLOFCMNDIR)/fs/pci-properties.fs \ diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs index a85f6c558e67..3e117ad03e09 100644 --- a/board-qemu/slof/OF.fs +++ b/board-qemu/slof/OF.fs @@ -143,6 +143,9 @@ check-for-nvramrc 8a0 cp +\ For DMA functions used by client/package instances. +#include "dma-instance-function.fs" + \ The client interface. #include "client.fs" \ ELF binary file format. diff --git a/slof/fs/dma-instance-function.fs b/slof/fs/dma-instance-function.fs new file mode 100644 index 000000000000..6b8f8a06fcba --- /dev/null +++ b/slof/fs/dma-instance-function.fs @@ -0,0 +1,28 @@ +\ ****************************************************************************/ +\ * Copyright (c) 2019 IBM Corporation +\ * All rights reserved. +\ * This program and the accompanying materials +\ * are made available under the terms of the BSD License +\ * which accompanies this distribution, and is available at +\ * http://www.opensource.org/licenses/bsd-license.php +\ * +\ * Contributors: +\ * IBM Corporation - initial implementation +\ ****************************************************************************/ + +\ DMA memory allocation functions +: dma-alloc ( size -- virt ) + s" dma-alloc" $call-parent +; + +: dma-free ( virt size -- ) + s" dma-free" $call-parent +; + +: dma-map-in ( virt size cacheable? -- devaddr ) + s" dma-map-in" $call-parent +; + +: dma-map-out ( virt devaddr size -- ) + s" dma-map-out" $call-parent +;