From patchwork Fri Jun 16 05:59:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Wang X-Patchwork-Id: 13282001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B725EB64D8 for ; Fri, 16 Jun 2023 05:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JQ4/HW1ZHkqyEm6+vGuyEPvbeF5+95L0BRQEFQxxqys=; b=qf8DqnoJj611F+ IvyWDYP1v1uZqp4g2eDHVo2XgBZUmnIpofOV22ZC4tba3FgUiGUAoO2XNX9G1fxpaE/AoaOOcdmde CbIrtiK+irb2Z0WmnVkey5TEMX/hj1qGSFOJQoMC9qV8DSEEfhk2QxujUoTiBNZVZBVc1uGvCm1gn dbVeUqqpvKZA2gu+bYhF9UmDVuxdjVGgAubFYjjVycdLvdTtwxMKFA2aI7Z6i17ex7i+0LDX595LN xbIR7f/4LzqPok3OkWTWRLcpDCT6TaDaFjCZCqjk+H9Py0smK88bj1xBxryNb0vpbn68QSAJIJrNo uzxQA9HpqY4WD3MBLQcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA2Eq-00Guny-1C; Fri, 16 Jun 2023 05:43:12 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA2En-00Gulm-09 for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 05:43:10 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 11E502006E5; Fri, 16 Jun 2023 07:43:02 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A7A1A20029D; Fri, 16 Jun 2023 07:43:01 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 5D5891820F57; Fri, 16 Jun 2023 13:43:00 +0800 (+08) From: Alison Wang To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: leoyang.li@nxp.com, xuelin.shi@nxp.com, xiaofeng.ren@nxp.com, feng.guo@nxp.com Subject: [PATCH 0/8] ethosu: Add Arm Ethos-U driver Date: Fri, 16 Jun 2023 13:59:05 +0800 Message-Id: <20230616055913.2360-1-alison.wang@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230615_224309_377882_AF638DFE X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series contains Arm's NPU Ethos-U driver for NXP i.MX93 platform. Ethos-U Linux driver is to provide an example of how a rich operating system like Linux can dispatch inferences to an Arm Cortex-M subsystem, consisting of an Arm Cortex-M and an Arm Ethos-U NPU. ---------------------------------------------------------------- Alison Wang (8): ethosu: Add Arm Ethos-U driver ethosu: Use RPMsg messaging protocol based on i.MX Rpmsg implementation ethosu: Add inference type option for model and op ethosu: Add suspend/resume power management ethosu: Use ids for identifying messages sent to Ethos-U firmware ethosu: Add core message about network info ethosu: Add core message about inference cancellation ethosu: Add rwlock when alloc and remove msg id drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/ethosu/Kconfig | 24 ++++ drivers/firmware/ethosu/Makefile | 31 +++++ drivers/firmware/ethosu/ethosu_buffer.c | 319 +++++++++++++++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_buffer.h | 106 +++++++++++++++ drivers/firmware/ethosu/ethosu_cancel_inference.c | 185 +++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_cancel_inference.h | 55 ++++++++ drivers/firmware/ethosu/ethosu_capabilities.c | 157 ++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_capabilities.h | 47 +++++++ drivers/firmware/ethosu/ethosu_core_interface.h | 276 ++++++++++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_device.c | 404 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_device.h | 81 +++++++++++ drivers/firmware/ethosu/ethosu_driver.c | 201 +++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_inference.c | 529 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_inference.h | 125 +++++++++++++++++ drivers/firmware/ethosu/ethosu_network.c | 229 +++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_network.h | 84 ++++++++++++ drivers/firmware/ethosu/ethosu_network_info.c | 184 +++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_network_info.h | 56 ++++++++ drivers/firmware/ethosu/ethosu_rpmsg.c | 414 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/firmware/ethosu/ethosu_rpmsg.h | 155 +++++++++++++++++++++ drivers/firmware/ethosu/uapi/ethosu.h | 285 +++++++++++++++++++++++++++++++++++++++ 23 files changed, 3949 insertions(+) create mode 100644 drivers/firmware/ethosu/Kconfig create mode 100644 drivers/firmware/ethosu/Makefile create mode 100644 drivers/firmware/ethosu/ethosu_buffer.c create mode 100644 drivers/firmware/ethosu/ethosu_buffer.h create mode 100644 drivers/firmware/ethosu/ethosu_cancel_inference.c create mode 100644 drivers/firmware/ethosu/ethosu_cancel_inference.h create mode 100644 drivers/firmware/ethosu/ethosu_capabilities.c create mode 100644 drivers/firmware/ethosu/ethosu_capabilities.h create mode 100644 drivers/firmware/ethosu/ethosu_core_interface.h create mode 100644 drivers/firmware/ethosu/ethosu_device.c create mode 100644 drivers/firmware/ethosu/ethosu_device.h create mode 100644 drivers/firmware/ethosu/ethosu_driver.c create mode 100644 drivers/firmware/ethosu/ethosu_inference.c create mode 100644 drivers/firmware/ethosu/ethosu_inference.h create mode 100644 drivers/firmware/ethosu/ethosu_network.c create mode 100644 drivers/firmware/ethosu/ethosu_network.h create mode 100644 drivers/firmware/ethosu/ethosu_network_info.c create mode 100644 drivers/firmware/ethosu/ethosu_network_info.h create mode 100644 drivers/firmware/ethosu/ethosu_rpmsg.c create mode 100644 drivers/firmware/ethosu/ethosu_rpmsg.h create mode 100644 drivers/firmware/ethosu/uapi/ethosu.h