From patchwork Sat Apr 27 22:04:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Cvetic X-Patchwork-Id: 10920515 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 82351912 for ; Sat, 27 Apr 2019 22:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70146285B5 for ; Sat, 27 Apr 2019 22:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6433B28606; Sat, 27 Apr 2019 22:05:51 +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=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 CD20E285B5 for ; Sat, 27 Apr 2019 22:05:50 +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=UT3zDlbuSEojSNJOQcpPHbNMfrzdRS1iFwrqLdHzCF8=; b=bCst++3xnI+0G/ HAp9FNrVAmoglfO5kz7DREFNl0O1F+c0IcPh8mm/iBc7aWksaZ76zHE1C81halXlJ6PKpPpURSzmE viyqiTTHemDIMjSRy0JF4JNN78J9MVJ9FaU94Ii7hEmksjvvdKTaowmXm64jLDblPkuOlbRKeeHUM 3xyyMEFjdYgECtJ3tPPMj4VeGAUJsM6yo2uWH+cyOR4604LDRAA1quN3fqMXEMO2ycDFA2V/Gi8NV nFKBYta70nQmQkIX0v82RHvb0B5dwHSVkTz1pfWyCbQ/0kdFSuz6EAq1O/fbfuJa4gYcGREHvz7BX qpnS1v3w6Juvzxqq1EOg==; 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 1hKVS5-0000uE-0s; Sat, 27 Apr 2019 22:05:45 +0000 Received: from mail-eopbgr810048.outbound.protection.outlook.com ([40.107.81.48] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKVRg-0000T2-0U for linux-arm-kernel@lists.infradead.org; Sat, 27 Apr 2019 22:05:23 +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=iQLnCvMprzYRiGDJZqEj7DmvjfCzG9sUil/nAZKCHUE=; b=LaEM8un1RZIT/Gs8TAUfRcoPxLPsSazrzbHh98YfPBlTJ1NspFtr3BNK87h/DPMCxl+d10emJcuhhgMt7UdrZLi58c8hcXU6ezVkLo2bAy7nZFwjhO8L/c7l0XBqDXqsWCJ5Y4XYxbqzuWJB7Tt7mrmLIGTBHnmJIIe69hQbJf8= Received: from BL0PR02CA0076.namprd02.prod.outlook.com (2603:10b6:208:51::17) by BY2PR02MB2006.namprd02.prod.outlook.com (2a01:111:e400:c504::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Sat, 27 Apr 2019 22:05:15 +0000 Received: from BL2NAM02FT013.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by BL0PR02CA0076.outlook.office365.com (2603:10b6:208:51::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1835.12 via Frontend Transport; Sat, 27 Apr 2019 22:05:14 +0000 Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by BL2NAM02FT013.mail.protection.outlook.com (10.152.77.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.1835.13 via Frontend Transport; Sat, 27 Apr 2019 22:05:14 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Sat, 27 Apr 2019 23:05:12 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Sat, 27 Apr 2019 23:05:12 +0100 Received: from [149.199.110.15] (port=52636 helo=xirdraganc40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1hKVRX-0002Gu-Vg; Sat, 27 Apr 2019 23:05:12 +0100 From: Dragan Cvetic To: , , , , , , Subject: [PATCH V3 00/12] misc: xilinx sd-fec drive Date: Sat, 27 Apr 2019 23:04:54 +0100 Message-ID: <1556402706-176271-1-git-send-email-dragan.cvetic@xilinx.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.80.198; IPV:CAL; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(376002)(136003)(2980300002)(199004)(189003)(9786002)(246002)(36756003)(44832011)(356004)(6666004)(2906002)(2201001)(7696005)(51416003)(28376004)(70206006)(7636002)(47776003)(70586007)(71366001)(107886003)(4326008)(60926002)(305945005)(5660300002)(26826003)(2616005)(336012)(93146003)(14444005)(26005)(36906005)(426003)(8676002)(50466002)(316002)(106002)(16586007)(50226002)(966005)(76130400001)(478600001)(54906003)(48376002)(476003)(186003)(6306002)(126002)(8936002)(956004)(110136005)(486006)(102446001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB2006; H:xir-pvapexch01.xlnx.xilinx.com; FPR:; SPF:Pass; LANG:en; PTR:unknown-80-198.xilinx.com; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b239fd2-ce6f-4fb0-0a89-08d6cb5c6ce2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328); SRVR:BY2PR02MB2006; X-MS-TrafficTypeDiagnostic: BY2PR02MB2006: X-MS-Exchange-PUrlCount: 3 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1824; X-Forefront-PRVS: 0020414413 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ddCohLG1l90X1QOruFmiepujhF5/W0bp+wsQg/Kx8mvY72nUvs5GRh4UMyH91kyY6u2EGPeKb3V4aF4CTMWxU7ZsXT0bBjpkKTbsaslNd6ew2Q7cDiPtsyuPv1QNZWolGVVtSNbtyaSdKV2JMR51LhyU6EoeQbXVo+QCRxByUyHspDhLOROrBu+7K6BSrC06uhIL0xDcnblqoUaP4jAGtS59c8yuyNzs0rcLU74o7R8biy50OaFRVyKMFu0uwarwbsRVODyqZ6hSQLv9m8TtJ/LZONZI23P9Z/a/pnloz8edARnoBy6YVOVP0Y3Hd454wxn/XEe142WTKnhAaduauL/1BvN3vcNGBzgerZliL5R1JURHChXdnO+UiQtx0KIDeGcSNXI/ONKBZgBZ4abxDLBlhI8Y4ymMEy0+rZAwl9M= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2019 22:05:14.2065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b239fd2-ce6f-4fb0-0a89-08d6cb5c6ce2 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB2006 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190427_150520_171623_43F026F1 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. 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: Dragan Cvetic , Derek Kiernan , linux-kernel@vger.kernel.org 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 patchset is adding the full Soft Decision Forward Error Correction (SD-FEC) driver implementation, driver DT binding and driver documentation. Forward Error Correction (FEC) codes such as Low Density Parity Check (LDPC) and turbo codes provide a means to control errors in data transmissions over unreliable or noisy communication channels. The SD-FEC Integrated Block is an optimized block for soft-decision decoding of these codes. Fixed turbo codes are supported directly, whereas custom and standardized LDPC codes are supported through the ability to specify the parity check matrix through an AXI4-Lite bus or using the optional programmable (PL)-based support logic. For the further information see https://www.xilinx.com/support/documentation/ip_documentation/ sd_fec/v1_1/pg256-sdfec-integrated-block.pdf This driver is a platform device driver which supports SDFEC16 (16nm) IP. SD-FEC driver supports LDPC decoding and encoding and Turbo code decoding. LDPC codes can be specified on a codeword-by-codeword basis, also a custom LDPC code can be used. The SD-FEC driver exposes a char device interface and supports file operations: open(), close(), poll() and ioctl(). The driver allows only one usage of the device, open() limits the number of driver instances. The driver also utilize Common Clock Framework (CCF). The control and monitoring is supported over ioctl system call. The features supported by ioctl(): - enable or disable data pipes to/from device - configure the FEC algorithm parameters - set the order of data - provide a control of a SDFEC bypass option - activates/deactivates SD-FEC - collect and provide statistical data - enable/disable interrupt mode Poll can be utilized to detect errors on IRQ trigger rather than using looping status and stats ioctl's. Tested-by: Santhosh Dyavanapally Tested by: Punnaiah Choudary Kalluri Tested-by: Dragan Cvetic Signed-off-by: Derek Kiernan Signed-off-by: Dragan Cvetic Changes V1 -> V2: - Removed unnecesary comenting from the commit messages. - Removed error log messages which can be triggered from user space. - Corrected the SDFEC table end addresses. - Removed casting between user pointer and kernel pointer. - Corrected definition of ioctl command code, used a corect type for size parameters. - Changes to declarations of IOCTL that pass structures, i.e. do not use pointers for sizeof as prevents compile time checks - IOCTL size fix, using a paging to manage a memory. Implemented a big tables transfer from user to kernel with get_user_pages_fast(). - Removed unnecessary check after container_of. - Removed not needed ioctl code checkes inside ioctl handler. - Implemented compat_ioctl. - Updated reviewer and tester lists. - Updated documentation, added Limitation chapter related to fork() and dup(). Link to V1 patch series: https://lore.kernel.org/lkml/1552997064-432700-1-git-send-email-dragan.cvetic@xilinx.com/ Changes V2 -> V3: - Corrected a licence in xilinx_sdfec.h changed to uapi licence format. - Corrected driver variable data types into user space data types. Link to V2 patch series: https://lore.kernel.org/lkml/1554804414-206099-1-git-send-email-dragan.cvetic@xilinx.com/ Dragan Cvetic (12): dt-bindings: xilinx-sdfec: Add SDFEC binding misc: xilinx-sdfec: add core driver misc: xilinx_sdfec: Add CCF support misc: xilinx_sdfec: Add open, close and ioctl misc: xilinx_sdfec: Store driver config and state misc: xilinx_sdfec: Add ability to configure turbo misc: xilinx_sdfec: Add ability to configure LDPC misc: xilinx_sdfec: Add ability to get/set config misc: xilinx_sdfec: Support poll file operation misc: xilinx_sdfec: Add stats & status ioctls Docs: misc: xilinx_sdfec: Add documentation MAINTAINERS: add maintainer for SD-FEC .../devicetree/bindings/misc/xlnx,sd-fec.txt | 58 + Documentation/misc-devices/index.rst | 1 + Documentation/misc-devices/xilinx_sdfec.rst | 291 ++++ MAINTAINERS | 12 + drivers/misc/Kconfig | 12 + drivers/misc/Makefile | 1 + drivers/misc/xilinx_sdfec.c | 1669 ++++++++++++++++++++ include/uapi/misc/xilinx_sdfec.h | 475 ++++++ 8 files changed, 2519 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/xlnx,sd-fec.txt create mode 100644 Documentation/misc-devices/xilinx_sdfec.rst create mode 100644 drivers/misc/xilinx_sdfec.c create mode 100644 include/uapi/misc/xilinx_sdfec.h