From patchwork Tue Jan 22 01:12:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyun Kwon X-Patchwork-Id: 10774759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E13C9746 for ; Tue, 22 Jan 2019 01:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD7B26224 for ; Tue, 22 Jan 2019 01:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C09822A76E; Tue, 22 Jan 2019 01:13:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 38F1426224 for ; Tue, 22 Jan 2019 01:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=GZWeF4syn89tXfyoJzpPVFoa8GUAu0UfTzA9KSGkQr8=; b=bZeKG/PtJlwcbf r5zFeOd++HCm4WtW/s00IarcU3DSxz8uzBk9ee14kbBx1pcsyT1SmB72BjKWNAlXG68/ymt9lAc7M zVkPtYnW145G5AS2I22oxU1Jn02YjDSn+sImKEnR4+o5ZKIuDzfUk1FxVXitQhNyimcnnDFgeZG5n cmObNZltBvk6MjZfmN93JPKYiiY7lBjjvAHT7EP2Z2DLkXwaxCPE//cd952Nx66ADwTpTfc+xd9HM vEkpkl7VvxAz2ZpxylX6IIhLZnN8+NBNqWHu2OnEtI2zyFUg4alUz7Pzb/Dx2E+O9T6rkbin7Of6y hM4KoZc6HSXh8UqSbYfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1glkdO-0007SX-IW; Tue, 22 Jan 2019 01:13:46 +0000 Received: from mail-by2nam01on062e.outbound.protection.outlook.com ([2a01:111:f400:fe42::62e] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glkdL-0007Rq-Ee for linux-arm-kernel@lists.infradead.org; Tue, 22 Jan 2019 01:13:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O+FAeGlh+R459tXPLmrf1oYGlF6egEsMt1A2KwmF56Y=; b=JePuWtGpUl4AwORUdRhbQQDEfHKMljzcsrb5o8oMBU8Ts485dZs7d5Q3aO5uw/3etyp5VaOZWMkp0ap+WNVejVKIAo/3UAz0+upLbOjlTCIvDXlVz+ugIubt/Hw43jVPGouL/Ppc0rwiMKzcEFBCGE+tXKLBAsidsYYAwdYK38o= Received: from CY4PR02CA0002.namprd02.prod.outlook.com (2603:10b6:903:18::12) by DM5PR0201MB3509.namprd02.prod.outlook.com (2603:10b6:4:76::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.31; Tue, 22 Jan 2019 01:13:39 +0000 Received: from BL2NAM02FT022.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by CY4PR02CA0002.outlook.office365.com (2603:10b6:903:18::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.27 via Frontend Transport; Tue, 22 Jan 2019 01:13:38 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT022.mail.protection.outlook.com (10.152.77.153) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1558.11 via Frontend Transport; Tue, 22 Jan 2019 01:13:38 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1glkdF-0008E3-SP; Mon, 21 Jan 2019 17:13:37 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1glkdA-0002CT-Mh; Mon, 21 Jan 2019 17:13:32 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0M1DV4Y005639; Mon, 21 Jan 2019 17:13:32 -0800 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1glkd9-0002C8-PV; Mon, 21 Jan 2019 17:13:31 -0800 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 347432C73A0; Mon, 21 Jan 2019 17:12:41 -0800 (PST) From: Hyun Kwon To: Rob Herring , Mark Rutland , Michal Simek , Greg Kroah-Hartman , , Subject: [PATCH 1/2] dt-bindings: soc: xilinx: Add the dt binding for Xilinx AI Engine Date: Mon, 21 Jan 2019 17:12:16 -0800 Message-ID: <1548119537-1788-1-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(189003)(199004)(478600001)(2201001)(50226002)(110136005)(63266004)(8936002)(103686004)(51416003)(106466001)(42186006)(316002)(336012)(16586007)(6666004)(356004)(107886003)(52956003)(90966002)(186003)(26005)(4326008)(81166006)(81156014)(2906002)(47776003)(426003)(36756003)(8676002)(50466002)(106002)(126002)(486006)(305945005)(48376002)(476003)(6266002)(2616005)(44832011)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3509; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT022; 1:8cvC3l+gcrIMeGubYVZ6POmfzNGCmMCWjdSJRq+VSZjIHjTX5CjfWGYlA4t2Mcd6WHAZY+RHWJeKOVHEaa33oCuSjhkqTA/m3owIFFRP8EdBwZqXx3XKdN4eI1fnY5CoyZRxJ3a97cVz+ZjRRNd0tw== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfc0609b-e6a4-4ed0-ca65-08d68006d711 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:DM5PR0201MB3509; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 3:duFxBF7mNcLBzbYmsaV5N3ScYXrUlD78BZ3DHl9+ISaArkBiN6fNXnNEf4OOUzgQJZMrYXCX/p+ILo6jREf4PIDatWa3T/5WcVXjRSxmlJBcHOXIVE3/6P3d03TCGs+yFrGVCCsSsbhvCa+gZXU8uCvvm+HL8a9VfFEC023xIPrdGA4xCCP/LjtfdDloWWHva2d7+8MV1SblOeNRExYabjgQRA9NSIhF+qNV2ShiKFzpI0Pi5WbIzFykTJCDIqN1My0eJ5nKEQ4m8sxYuP4PIMR4EPO/sCqpVFMhjlPhK0caYle3bl/Ara2F9so2ONu2nh9KLw05IVtgjrohRvBgNlcQtKKqQT6uc8gd48gyEKr6vcFNNn6y3H9V1bWuuLN6; 25:ceEK8WAfxN7sHjhHfRYYp3bhvZQ2rGgg2kn7azxu4c+6lAQJ4dugQxuLrwQI0Pu//iFUxwQM9fapgAuH/kokvgHflmGEtVvg9crpkjYBdldpw9rJ1NRJ4RRE1FFcNpyk9bHZhEu/8T4ePXtl7kfWtYF1c/U5B0jlwYl9whjOVakvyJFh8VGsYdbbdR98n8aOS51SH3kXL+3JSAsVdBJww/VTKYHPYbzXjRkg7OQ8e16uD33w0Sp/bG2M09ZXJMcAMm+lWsFGnyFMZhdiokVv8aefQ/rQair6QJ/A0mlYYTHD3hFpyaf9FeCWbmVbhrllVUk3oguEWsHEsWA142foAQ== X-MS-TrafficTypeDiagnostic: DM5PR0201MB3509: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 31:Nm3TmPy7fZAI0NMj/blwEA7CGvQGXKaUD2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Vn8OTBz0NLCphKLkQ==; 5:BGriApn4epWcbQ9yDw3qyCEy+tyRMqcUGvFKqmUdCal+fLfyWcGytR+0spkOBNlUJsB6nslwFAb0jbuy1dT1dM4iEM9vI4Vln/xg2ZIREqVJKUupPvE8S9YwvPoSGIEioWbAih9uCRvNRO2FehqfvLsjV8dmo1xq8SZqI0kfRy8gmvcUseLB77Wm1kApzsgb01rJq7emFueNggEMApJZRg==; 7:BruoP5h+3RQQ2bQyhJNirjFyg/0t0mzukyCSoCyKT2D0WL2p/LBi28VLUO3smOvaEUj3SnP3ih1xFC7kJpxXSAgSxSIwX4bXGF03bSaagZCflMFX0YmL08mIe/pVUXDpFupqJ3cPntZYxrSPUvQ9HQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2019 01:13:38.4211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfc0609b-e6a4-4ed0-ca65-08d68006d711 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3509 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190121_171343_546858_3679A938 X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hyun Kwon Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the dt bindings for Xilinx AI Engine, which is a tile processor with many cores. The compatible string, 'xlnx,mathengine' is kept for backward compatibility as it's the legacy name. Signed-off-by: Hyun Kwon Signed-off-by: Michal Simek --- .../devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt | 19 +++++++++++++++++++ MAINTAINERS | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt diff --git a/Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt b/Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt new file mode 100644 index 0000000..fade9d0 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt @@ -0,0 +1,19 @@ +Xilinx AI Engine +---------------- + +The Xilinx AI Engine is a tile processor with many cores (up to 400) that +can run in parallel. The data routing between cores is configured through +internal switches, and shim tiles interface with external interconnect, such +as memory or PL. + +Required properties: + +- compatible: Must be "xlnx,ai_engine", or "xlnx,mathengine" for legacy name. +- reg: Physical base address and length of the registers set for the device. + +Example: + + ai_engine@80000000 { + compatible = "xlnx,ai_engine"; + reg = <0x0 0x80000000 0x0 0x20000000>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 32d44447..d119d1d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16040,6 +16040,11 @@ F: Documentation/driver-api/uio-howto.rst F: drivers/uio/ F: include/linux/uio_driver.h +USERSPACE I/O (UIO) DRIVER FOR XILINX AI ENGINE +M: Hyun Kwon +S: Maintained +F: Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt + UTIL-LINUX PACKAGE M: Karel Zak L: util-linux@vger.kernel.org From patchwork Tue Jan 22 01:12:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyun Kwon X-Patchwork-Id: 10774761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA507746 for ; Tue, 22 Jan 2019 01:14:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D701C26224 for ; Tue, 22 Jan 2019 01:14:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5EC22A76E; Tue, 22 Jan 2019 01:14:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1519326224 for ; Tue, 22 Jan 2019 01:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k5MNRhzX2ZE9A+yWOeGi6nTAHnCsL1kto5CyaLc8ooE=; b=GaQ4O/SG57iJxz QB/aiVdU6wB+6zNCrTKRGN0679oobgM2q2J+mzJMuBeCKQw+KlIe/kzbMjKufGl4PqpBRuNzGhqZb hoxVdKfbG6zY8m9MpAnk63g/AlkDBpl2XPfoOu1PA2ruSvkC9WbfukZ8ZTYu8aAStB+E0+FHHFoPb cWNy2BjlRAhFQApnffPcZx9EtRqII7WemJM4/rZAj1nwlK4BKBd4xuupVLFKNjuUjfFqYEOGXTPGI M+Z6Ux5KVXVkl47CWEqh4pZUTNz+9Sl72jSFe5GMJUx+k6lfJs+QFxetlOPwhTn6alrYefS45dGJu ycioOJpjYN65+riEKGrw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1glkdY-0007cV-2i; Tue, 22 Jan 2019 01:13:56 +0000 Received: from mail-by2nam01on061a.outbound.protection.outlook.com ([2a01:111:f400:fe42::61a] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glkdL-0007Rs-KR for linux-arm-kernel@lists.infradead.org; Tue, 22 Jan 2019 01:13:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ViLx5/KYrfMhvF5ovod79twx4wQR/DWSjVKJSEEU7rs=; b=mLVHU3wlKpIqTGgShUf1VVHuhQA+ckupxQ10zzh3shQchQGsWMTF7fVlU3qO7QE1TCxY4Wl0qac/GRrMb23qOcFDHDuoYA0ajdeWisOEDUGTlhq6sKbHHvWs4P5wYAJomQNxhx2eGkpKvTCRZ6XQ6hbcS7ihJHEbKyT457pGaJA= Received: from MWHPR0201CA0094.namprd02.prod.outlook.com (2603:10b6:301:75::35) by BL0PR02MB4324.namprd02.prod.outlook.com (2603:10b6:208:40::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29; Tue, 22 Jan 2019 01:13:40 +0000 Received: from SN1NAM02FT041.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by MWHPR0201CA0094.outlook.office365.com (2603:10b6:301:75::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29 via Frontend Transport; Tue, 22 Jan 2019 01:13:39 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT041.mail.protection.outlook.com (10.152.72.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1558.11 via Frontend Transport; Tue, 22 Jan 2019 01:13:39 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1glkdG-0008E4-My; Mon, 21 Jan 2019 17:13:38 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1glkdB-0002Cu-Hx; Mon, 21 Jan 2019 17:13:33 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0M1DWbi005655; Mon, 21 Jan 2019 17:13:32 -0800 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1glkdA-0002CZ-NY; Mon, 21 Jan 2019 17:13:32 -0800 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 26B5D2C73A0; Mon, 21 Jan 2019 17:12:42 -0800 (PST) From: Hyun Kwon To: Rob Herring , Mark Rutland , Michal Simek , Greg Kroah-Hartman , , Subject: [PATCH 2/2] uio: Add the UIO driver for Xilinx AI Engine Date: Mon, 21 Jan 2019 17:12:17 -0800 Message-ID: <1548119537-1788-2-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548119537-1788-1-git-send-email-hyun.kwon@xilinx.com> References: <1548119537-1788-1-git-send-email-hyun.kwon@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(396003)(136003)(2980300002)(199004)(189003)(316002)(478600001)(6266002)(426003)(16586007)(186003)(42186006)(107886003)(486006)(126002)(50466002)(6666004)(336012)(356004)(47776003)(106002)(476003)(44832011)(4326008)(11346002)(446003)(103686004)(2616005)(110136005)(52956003)(106466001)(14444005)(2906002)(90966002)(48376002)(8676002)(81166006)(50226002)(305945005)(51416003)(8936002)(36756003)(26005)(63266004)(81156014)(2201001)(76176011)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4324; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT041; 1:lqS9z51qv+UUOFF1w9cC/billkcA1P1NbeTFTmbZM651NE2gsj5wUBp+m8R8n/AezYEBwgsEBzo0ifWUez/hkQV8ZPIyFIX02xYYlrSGSK7MeGRBFSdl/NYCPfCPhPpeEqPQP79ibBMP4P8xWGUHsQ== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8905efa8-7e4c-4eed-4721-08d68006d78c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:BL0PR02MB4324; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4324; 3:p1mDPkBMg69WNmF4QylL6UqMadFIL5H3sRpcfQImvmpOhZaE3vlaaNB3dl0oscOpls7jDSxtMMDlrd6WALAtTxhULlfL2ZZswLrNKviJbk1t8k7MNeMTWzruh/YW7P5I52pj4biKuTlK86N2bJoruvul2v5apvY0KXdDkJOrQqlyWfsS8bXWxAmCOxljfCOX/Y0gCQ2Bz+/bRqDWt9cTtX8O4k27AnTOdlw70KUP+yaexssSEsWH/6PqvEjnVHORKUVy0iz+7wACvpnykbZtjEO05+5IZpZ0LIP1KGnuphOMSZbfqQeDfNQzDPwJhF6cDFRJtHihq7BQEol6Jk86hpUbuPzeNVR17uzW8KliLJknHWBoxpY39gP9MYoLqowe; 25:sbhXqLbNPeswxNynpJWTRaMfkVK1RPnGcdLlpqI2X9XqBf3B2UB1vuVuPMpq3kBTJGygbOxWTnYTxNn1fdt9GFeCG3jFHGNxEKAsIqBYckYlDKFUUoN6ndd6ZjjYxgHFp8qdG5YkqFdKdtQRJLZLGzhgA8iAgIY8u7hYgop7DYCZWmLSRlEFtXtI/LPt9lJMi0r00wVmRTFPakyOV1JhLZb/t/r+6wLG3UJ1mu/t17aoCgu7aW84tGjh9oISsob/vd69D04zDPSn8Vw0TUAHNGEiP7gdLbBfqc8q+G9BRXE3zdfoSZusRAqvlCYRUYUntR0eYkZk160AEhWzkLpwzg== X-MS-TrafficTypeDiagnostic: BL0PR02MB4324: X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4324; 31:ic7vMfpTXpqBC5Z7cq9rIVLctOJMP5LjZRq87R1/YomuOANscZpn2Wpa4r/vwQydoF/TVJ10EV7IJg7kLtPKFgRSARtSCz4+Nu9TwbVcXXkC+AX0kx9zPB9DB53uk1pW76SBD8UF+TTBBwn2mIRsxaNVpl+FA9lSioLok6MKqVNoHCvSmCPkPS1nwwmsrw6LRGZLyQfGCBmq+Vgdwal1KCmD09QzoOqPGk/CfcUL0Mg=; 20:atseji836JVdzdK0Yr0g4VkGRwM4BS3XSxEoC72sqli/zYCQvLCLHMOveZcUzL28W9P2MpZwrEJlTy3s2QKxGIlBJxj/uO9/g7XdaDQGz2IjMoRDo6gCCVlJv9BdV8/XCkzJ4VR0d5HhYzEgvF1mWhZC1ItHMlX9bLDm0o9S1OctLFimW2kXXkqJ+/j4vARHBU0VCYsvxgdMj3O/SQ9YeygKxe0GlBzSO2zo7aGrluPEuiMwXtvp21IBCpuk83IOMdN3opdZdojb2AVC9NUVRgrYav0pGnPB+tzdk7gWX7AL3vg77nooPzFv8r5lLZxdVoyLOoMl5i5zQVugb9yUL6yqjI8YnVGCDCWjrYh2DS8T3Lq5xHUCgqRTZUTiJg0JE17F2L/HyhFt+id/pSTfvnGVwteJ01sTSna4gu5J7jJzoAgn7EMZsINgIzSw8yujcbNpRATluS7Nz1ACo3AblSPI6Hd8cZQR95XahZ+HFV1Kfr11+d3N8doi7zzsWZyE X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4324; 4:MmWKeIVKYi8st6cEbKMH+JC7gmL/N9BojhftfXmVwLcohdffHGJM/HeFmxfZdQZQcBnltcI6sacPVCMDvvv/4Kx5w5UUxDbfUr+DLx3oeH1DMe//WdKEhU50aDTUuuTPn78VpjS7ZeVcF6wBiz14bcPAWfMXoe365xLCBmWm3DxU979QFaT9WugAZhpdmzHIB2OWqxI823p7nT26j0aW1Zk19ttivJ8ItMXAiaXP1dGqMwuw515ES5X4diujr94crx2MKSgH+D8qOephfEe+M/S6DuaU9puBpW2N3iSr2g1Sv25fQfRRmPE7TfKmMsiP X-Forefront-PRVS: 0925081676 X-Microsoft-Exchange-Diag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UrZPmbdYVRCVfMQl9E8+kKFr0x57rpnHjfj+QWtJV9CqMfO7UVTay9/bszZ/Jcho89VFH0msodnt+4enp0i741fQuSzSqll0jD0XQrQ0TusO8DFeOCmaLche+aWvyuQp+iULY/9YalZsKTI2AS4ucFFa339fvxQfhCboAIlxGnuUJIQYOyAD6lawK4EpnJ0qFROUwt5554W2czTsaOHFw==; 7:gOK0hywZCEjEuSFa2BvyivH4+6n0MpQVa2XE77ZwOVI4CrQm6hrZ7lLYfH09n6FSc34UeFPc5H1+D7zZ9Vro2A9ucRm5yHuyoWpEMsgKD1k/9sijQzf3JTv2QbNF/z/WQUBl4KlUDC2D5taIR9ROPw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2019 01:13:39.0832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8905efa8-7e4c-4eed-4721-08d68006d78c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4324 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190121_171343_829916_49B13536 X-CRM114-Status: GOOD ( 23.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hyun Kwon Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the UIO driver for Xilinx AI Engine. The driver is more or less a simple wrapper that enables the UIO dmem genirq with some required configurations, because the UIO dmem driver is not probed through DT compatible string. This driver initializes the UIO dmem by adding it as a child device. While doing it, any resources in this driver DT node is mirroed to the child node so that those resources can be accessed by UIO if needed. As a part of it, the child device is set up with parent node DMA configuration. In addition, this driver specifies some information that the UIO dmem driver expects, which includes, - uioinfo: version, name, irq type, mem offsets,,, - memory allocation information: size and number of chunks Signed-off-by: Hyun Kwon --- MAINTAINERS | 1 + drivers/uio/Kconfig | 10 +++ drivers/uio/Makefile | 1 + drivers/uio/uio_xilinx_ai_engine.c | 176 +++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 drivers/uio/uio_xilinx_ai_engine.c diff --git a/MAINTAINERS b/MAINTAINERS index d119d1d..bced6f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16044,6 +16044,7 @@ USERSPACE I/O (UIO) DRIVER FOR XILINX AI ENGINE M: Hyun Kwon S: Maintained F: Documentation/devicetree/bindings/soc/xilinx/xlnx,ai_engine.txt +F: drivers/uio/uio_xilinx_ai_engine.c UTIL-LINUX PACKAGE M: Karel Zak diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig index 7e8dc78..5a25241 100644 --- a/drivers/uio/Kconfig +++ b/drivers/uio/Kconfig @@ -164,4 +164,14 @@ config UIO_HV_GENERIC to network and storage devices from userspace. If you compile this as a module, it will be called uio_hv_generic. + +config UIO_XILINX_AI_ENGINE + tristate "Xilinx AI Engine driver" + select UIO_DMEM_GENIRQ + help + The driver for Xilinx AI Engine that utilizes the uio_dmem_genirq. + The userspace library will use this to interact with the AI Engine + hardware, as well as for the memory allocation. + Say 'y' only for platforms with the MathEngine IP. + endif diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile index c285dd2..26b2739 100644 --- a/drivers/uio/Makefile +++ b/drivers/uio/Makefile @@ -11,3 +11,4 @@ obj-$(CONFIG_UIO_PRUSS) += uio_pruss.o obj-$(CONFIG_UIO_MF624) += uio_mf624.o obj-$(CONFIG_UIO_FSL_ELBC_GPCM) += uio_fsl_elbc_gpcm.o obj-$(CONFIG_UIO_HV_GENERIC) += uio_hv_generic.o +obj-$(CONFIG_UIO_XILINX_AI_ENGINE) += uio_xilinx_ai_engine.o diff --git a/drivers/uio/uio_xilinx_ai_engine.c b/drivers/uio/uio_xilinx_ai_engine.c new file mode 100644 index 0000000..65dc99c --- /dev/null +++ b/drivers/uio/uio_xilinx_ai_engine.c @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx UIO driver for AI Engine + * + * Copyright (C) 2018 Xilinx, Inc. + * + * Author: Hyun Woo Kwon + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DRIVER_NAME "xilinx-aiengine" + +static uint xilinx_ai_engine_mem_cnt = 1; +module_param_named(mem_cnt, xilinx_ai_engine_mem_cnt, uint, 0444); +MODULE_PARM_DESC(mem_cnt, "Dynamic memory allocation count (default: 1)"); + +static uint xilinx_ai_engine_mem_size = 32 * 1024 * 1024; +module_param_named(mem_size, xilinx_ai_engine_mem_size, uint, 0444); +MODULE_PARM_DESC(mem_size, + "Dynamic memory allocation size in bytes (default: 32 MB)"); + +static int xilinx_ai_engine_mem_index(struct uio_info *info, + struct vm_area_struct *vma) +{ + if (vma->vm_pgoff < MAX_UIO_MAPS) { + if (info->mem[vma->vm_pgoff].size == 0) + return -1; + return (int)vma->vm_pgoff; + } + return -1; +} + +static const struct vm_operations_struct xilinx_ai_engine_vm_ops = { +#ifdef CONFIG_HAVE_IOREMAP_PROT + .access = generic_access_phys, +#endif +}; + +static int xilinx_ai_engine_mmap(struct uio_info *info, + struct vm_area_struct *vma) +{ + int mi = xilinx_ai_engine_mem_index(info, vma); + struct uio_mem *mem; + + if (mi < 0) + return -EINVAL; + mem = info->mem + mi; + + if (mem->addr & ~PAGE_MASK) + return -ENODEV; + if (vma->vm_end - vma->vm_start > mem->size) + return -EINVAL; + + vma->vm_ops = &xilinx_ai_engine_vm_ops; + /* + * Make the dynamic memory mapping as write-combined. Only first one + * will be the mmio region, which will be mapped as noncached. + */ + if (mi < 1) + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + else + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); + + /* + * We cannot use the vm_iomap_memory() helper here, + * because vma->vm_pgoff is the map index we looked + * up above in uio_find_mem_index(), rather than an + * actual page offset into the mmap. + * + * So we just do the physical mmap without a page + * offset. + */ + return remap_pfn_range(vma, + vma->vm_start, + mem->addr >> PAGE_SHIFT, + vma->vm_end - vma->vm_start, + vma->vm_page_prot); +} + +static int xilinx_ai_engine_probe(struct platform_device *pdev) +{ + struct platform_device *uio; + struct uio_dmem_genirq_pdata *pdata; + unsigned int i; + int ret; + + uio = platform_device_alloc(DRIVER_NAME, PLATFORM_DEVID_NONE); + if (!uio) + return -ENOMEM; + uio->driver_override = "uio_dmem_genirq"; + uio->dev.parent = &pdev->dev; + + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + ret = -ENOMEM; + goto err_out; + } + + pdata->num_dynamic_regions = xilinx_ai_engine_mem_cnt; + pdata->dynamic_region_sizes = &xilinx_ai_engine_mem_size; + pdata->uioinfo.name = DRIVER_NAME; + pdata->uioinfo.version = "devicetree"; + pdata->uioinfo.irq = UIO_IRQ_CUSTOM; + pdata->uioinfo.mmap = xilinx_ai_engine_mmap; + /* Set the offset value as it's map index for each memory */ + for (i = 0; i < MAX_UIO_MAPS; i++) + pdata->uioinfo.mem[i].offs = i << PAGE_SHIFT; + ret = platform_device_add_data(uio, pdata, sizeof(*pdata)); + if (ret) + goto err_out; + + /* Mirror the parent device resource to uio device */ + ret = platform_device_add_resources(uio, pdev->resource, + pdev->num_resources); + if (ret) + goto err_out; + + /* Configure the dma for uio device using the parent of_node */ + uio->dev.bus = &platform_bus_type; + ret = of_dma_configure(&uio->dev, of_node_get(pdev->dev.of_node), true); + of_node_put(pdev->dev.of_node); + if (ret) + goto err_out; + + ret = platform_device_add(uio); + if (ret) + goto err_out; + platform_set_drvdata(uio, pdata); + + dev_info(&pdev->dev, "Xilinx AI Engine UIO driver probed"); + return 0; + +err_out: + platform_device_put(pdev); + dev_err(&pdev->dev, + "failed to probe Xilinx AI Engine UIO driver"); + return ret; +} + +static int xilinx_ai_engine_remove(struct platform_device *pdev) +{ + struct platform_device *uio = platform_get_drvdata(pdev); + + platform_device_unregister(uio); + of_node_put(pdev->dev.of_node); + + return 0; +} + +static const struct of_device_id xilinx_ai_engine_of_match[] = { + { .compatible = "xlnx,ai_engine", }, + { .compatible = "xlnx,mathengine", }, + { /* end of table */ }, +}; +MODULE_DEVICE_TABLE(of, xilinx_ai_engine_of_match); + +static struct platform_driver xilinx_ai_engine_driver = { + .probe = xilinx_ai_engine_probe, + .remove = xilinx_ai_engine_remove, + .driver = { + .name = DRIVER_NAME, + .of_match_table = xilinx_ai_engine_of_match, + }, +}; + +module_platform_driver(xilinx_ai_engine_driver); + +MODULE_AUTHOR("Xilinx, Inc."); +MODULE_LICENSE("GPL v2");