Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp676302pxu; Fri, 11 Dec 2020 11:26:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuUe8eFnCRnU8K7tb+gb0FhHFAHcVrNjGC83j8azHnXjKoyxNnTjutwj9U679BxHErFw0+ X-Received: by 2002:a50:8163:: with SMTP id 90mr13189408edc.142.1607714777806; Fri, 11 Dec 2020 11:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607714777; cv=none; d=google.com; s=arc-20160816; b=rqpgndPNtaWKMEUjAsob4O/Ik3e1MjaV1OtvMxkHVBh+BEPjyhlZsjeRD1mG0vWq8h KdQNxggNJIHKtBtWv1WyRwaEUAFn38LAPorBL4oUFfgnZk/68tKG2WM6x9JPIkFCT4A7 7nj1evA02Tw1qnccnD+N7fnbGlQaFuJn8nhOq3C572/Br4Nc/UaZO7+bevzTnZAA9d2b j+46+bH0id87gRV9ndg1etY0jUegzg7bIH2fYj2hMwrZEdcxxAHKnvv0ummdg1FBW3MS MOjYZoPAfMPZbZWTn8FKWqFtKt7u0llOqDQpmh+LmNCBcfxTS6Uvk6DMOXPL+cZYuwbg oLug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hMSZzneyru50Jjj6PQ349xugCKpWN0AAxELTHUziJRQ=; b=eovtGkaUTYg6pXIrpylJFMTCUq8jtC6f4mUEPqQ9OAGjqoNNIKjUQ2O0rcPup8DQ6i gwP5m1aDLAN4Y4M65Kv5kb1rwpB1+82t40RMvlYGhnUVPJcLdakrKkjSWVVpldr71Gzr Jikk97+ONaLyz8ocTcuoBEpDBvbxjJ7x5TT/WTjnHtLoMCIGhjLkZnV8v9XBwQPEDYKt x2QSZ+BE4QYZ7KqVEzmXLm95mcLtwT4x9JaqlSCRpk1MbcTJo9sDmBWiIf9boVERNjlI XUJ7IK9kpEaubyIaoKkrtP0EFJLhR8arcYWh+JVzXCli9CtkjzHv/OaNZOcQq4fPQZWG TJKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="e/3x12Fg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt17si5693413edb.469.2020.12.11.11.25.54; Fri, 11 Dec 2020 11:26:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="e/3x12Fg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391752AbgLKTEm (ORCPT + 99 others); Fri, 11 Dec 2020 14:04:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388276AbgLKTEM (ORCPT ); Fri, 11 Dec 2020 14:04:12 -0500 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AAC4C0613CF; Fri, 11 Dec 2020 11:03:31 -0800 (PST) Received: by mail-ot1-x344.google.com with SMTP id 11so9172499oty.9; Fri, 11 Dec 2020 11:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hMSZzneyru50Jjj6PQ349xugCKpWN0AAxELTHUziJRQ=; b=e/3x12FgAZ2f6zDCJbdCrGnFjHRooeKYCO5Lj/7CTcVjWow3xKvntvdwjioO+bb+xv g9XYxsfeTtpYsapnCuBfdjL2E7koXIYCOQOsbIuV3cbxA5qZrgNegyd1sQl7PlF71lpj SFLfykKC+SoOxkdRyDY7aF09ldBEKqHcYwdaaZN/Qcyj12PINOF+3yuVZYoKeeZ54fy/ 3fTDlCXaVPH9rCNy5P18xqTAaZOozDv4Yk4IMDxOPcCy2rO6nfE39MwRX2kK6p3LjL3t LRLTN/3+N+n4QK9WKV/LJU1MPOpLFRJ+wJf8Jc1szsU7TJNgp40ePZvE4VvKa2audbFK vrjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hMSZzneyru50Jjj6PQ349xugCKpWN0AAxELTHUziJRQ=; b=oUAKR0OVthQkUvoraci8QSvVSVT/3xMiO34GEZxM8GGtwe+nky9xpFrdlUh9PieMQU YHjuPpY6e1rTHYkfrOj1xEmds8BlpCBaRnQgzk28EfzGHkdhCCgFC6D4dvS8loXebgm4 VGIQkf/q2X4hH9vW7joGdDLULr205kYjD35TftcnsMQp0DUQvy0HxGDoyx0xOANIGEiR w63rNCd2kL9BjkaVlALok1eTU4uS3mw8Flg23Wi5TuTV7cpRcnl+aqjhiwvJoCyAEHbk acVIRibMfzN9hTFmoCJztIuotvDnQpSkXoArUy2T2sKc9jZRuxCmWsfXqXAxxIIvWZVP D8Cg== X-Gm-Message-State: AOAM530wzNl2XzRZ0heFQCI5xADn3UrCHT4SlpawoR+JtRl4LMlWs6uO 57z+U9V1KajEQmfE0I3QaNpYo/q3nzpUlStX1vY= X-Received: by 2002:a9d:4ce:: with SMTP id 72mr10975948otm.23.1607713410935; Fri, 11 Dec 2020 11:03:30 -0800 (PST) MIME-Version: 1.0 References: <1606722505-16194-1-git-send-email-wendy.liang@xilinx.com> In-Reply-To: <1606722505-16194-1-git-send-email-wendy.liang@xilinx.com> From: Alex Deucher Date: Fri, 11 Dec 2020 14:03:19 -0500 Message-ID: Subject: Re: [PATCH v3 0/9] Xilinx AI engine kernel driver To: Wendy Liang Cc: Rob Herring , michal.simek@xilinx.com, Arnd Bergmann , Greg KH , Sumit Semwal , Christian Koenig , derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com, rajan.vaja@xilinx.com, tejas.patel@xilinx.com, manish.narani@xilinx.com, ravi.patel@xilinx.com, devicetree@vger.kernel.org, LKML , Maling list - DRI developers , linux-arm-kernel , linux-media Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 3:25 AM Wendy Liang wrote: > > AI engine is the acceleration engine provided by Xilinx. These engines > provide high compute density for vector-based algorithms, and flexible > custom compute and data movement. It has core tiles for compute and > shim tiles to interface the FPGA fabric. > > You can check the AI engine architecture document for more hardware details: > https://www.xilinx.com/support/documentation/architecture-manuals/am009-versal-ai-engine.pdf > > This patch series adds a Linux kernel driver to manage the Xilinx AI > engine array device and AI engine partitions (groups of AI engine tiles > dedicated to an application). Hi Wendy, I think it would be good to provide an overview of how your stack works in general. That would give reviewers a better handle on how all of this fits together. I'd suggest including an overview in the cover letter and also in the commit message and/or as a comment in the code in one of the patches. I'm not really an expert when it comes to FPGAs, but this basically looks like a pretty low level interface to set up the data fabric for a kernel that will run on the soft logic or maybe the microcontroller on the board. It doesn't have to be super detailed, just a nice flow for how you might use this. E.g., Userspace uses ioctls X, Y, Z to configure the data fabric for the FPGA kernel. The kernels can run on... . DMA access to system memory for data sets can be allocated using ioctl A. DMA access is limited by... . The user can then load the FPGA kernel on to one of the engines using ioctl B and finally they can kick off the whole thing using ioctl C. FPGA kernels are compiled using YYY toolchain and use use the following runtime (link to runtime) to configure the data fabric using ioctls X, Y, Z. It would also be good to go over the security implications of the design. E.g., can the FPGA kernel(s) access the DMA engine directly, or is it limited to just the DMA regions set up by the ioctls? Also, does the hardware and software design allow for multiple users? If so, how does that work? Thanks, Alex > > v3: > * unlock AIE dev mutex after failed to gain the partition lock in > errors handing > * replace pointer with __u64 and enum with __u32 in ioctl > > v2: > * Fix dtschema check errors > * Fix test bot warning on interrupt implementation. Removed set but > unused varaible. > * Fix compilation unused function warning of firmware change in case > ZynqMP firmware is not configured > * There are other warning on ZynqMP firmware reported from testbot > which is not introduced by this patch set. > "[PATCH] firmware: xlnx-zynqmp: fix compilation warning" is submitted > for those fixes. > > > Izhar Ameer Shaikh (1): > firmware: xilinx: Add IOCTL support for AIE ISR Clear > > Nishad Saraf (2): > misc: xilinx-ai-engine: Add support to request device management > services > misc: xilinx-ai-engine: Add support for servicing error interrupts > > Wendy Liang (6): > dt-binding: soc: xilinx: ai-engine: Add AI engine binding > misc: Add Xilinx AI engine device driver > misc: xilinx-ai-engine: Implement AI engine cleanup sequence > misc: xilinx-ai-engine: expose AI engine tile memories to userspace > misc: xilinx-ai-engine: add setting shim dma bd operation > misc: xilinx-ai-engine: add request and release tiles > > .../bindings/soc/xilinx/xlnx,ai-engine.yaml | 126 ++++ > MAINTAINERS | 8 + > drivers/firmware/xilinx/zynqmp.c | 14 + > drivers/misc/Kconfig | 12 + > drivers/misc/Makefile | 1 + > drivers/misc/xilinx-ai-engine/Makefile | 16 + > drivers/misc/xilinx-ai-engine/ai-engine-aie.c | 608 +++++++++++++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-clock.c | 245 ++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-dev.c | 496 ++++++++++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-dma.c | 481 +++++++++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-internal.h | 519 ++++++++++++++++ > .../misc/xilinx-ai-engine/ai-engine-interrupt.c | 659 +++++++++++++++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-mem.c | 275 +++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-part.c | 635 ++++++++++++++++++++ > drivers/misc/xilinx-ai-engine/ai-engine-res.c | 219 +++++++ > drivers/misc/xilinx-ai-engine/ai-engine-reset.c | 159 +++++ > include/linux/firmware/xlnx-zynqmp.h | 8 + > include/uapi/linux/xlnx-ai-engine.h | 238 ++++++++ > 18 files changed, 4719 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/xilinx/xlnx,ai-engine.yaml > create mode 100644 drivers/misc/xilinx-ai-engine/Makefile > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-aie.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-clock.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-dev.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-dma.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-internal.h > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-interrupt.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-mem.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-part.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-res.c > create mode 100644 drivers/misc/xilinx-ai-engine/ai-engine-reset.c > create mode 100644 include/uapi/linux/xlnx-ai-engine.h > > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel