Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4675146ybi; Tue, 11 Jun 2019 10:32:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsAFfc1pDOcRjheL8HrnISKCuUi8CRcsRjWOi8Qsb54eZ63MKL86k5z6tWLmj2+sYp1MXi X-Received: by 2002:aa7:82cd:: with SMTP id f13mr83872066pfn.203.1560274329106; Tue, 11 Jun 2019 10:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560274329; cv=none; d=google.com; s=arc-20160816; b=c70P1RD6HHysvfzvOpCbgJLOEW5Ifos3AkFFlICLe2W1oaSjl/wwzNbmLeg/TxyHy7 agXVGrWsgSnUMSMuR6NhOBZM9XUPz2KDOzgaxdMNJ7OsgG0z7DenFBXDoA0Xls6g71xz 0Qw/hLKyi8bp7/4PfG7VavkJ5rr5Xx2osZ41CXhFR9Nm4JkFCYGq4cxh81s/cv7HjcFP BJS7C+3u/g1KG8V3gIiEyJrMWNix5EzmhzVRUUe4OuTv/3tJioXPMnmZbrlGKQZ1GLDS 5d8qgUxcsC+z5lWR252bCGJUco3M+2ziSwcZOh2V53Nn3UvciXAIbjBgEwNcMn/V/9CH TTsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:envelope-to:dkim-signature; bh=1DqP+Z9XGiyJYY/FubOBjc7rK1Xg2and/BaFlgFZYcA=; b=Inqrbx4ZuAE2+12qEIg2ByZ2WcvxUqDWRgm2XSaDwQZD8ggolbuc8YYDijpMsbyWVN ORkQk0x5uZ4NoHDrGLOTpe3ljLD9dKDeo9XwAzPPIErIv3AEd4kWV01hXmPMlzQLmRM0 IO/bN8KRixOp4wBpMrHzwy0k2HKPqh+9xHNjCbIVJH7KR5x8f4GmJpXTFeGZ8GfhTB0O 3SXL0jgfX+ubIvTTB/nLOAoaucOLCuHODIHweECesCO/xzYdJ6wmQi+s4CsGGPTR8Gd1 oGUzTtofOQ3lsdHyVJSjrOIOF1y4WACuYeMpt9tW1ooGUb0wu/CEMAW4syYn/OPWpRHP BDDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-onmicrosoft-com header.b="BP/JzHHS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i97si13797564plb.50.2019.06.11.10.31.53; Tue, 11 Jun 2019 10:32:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-onmicrosoft-com header.b="BP/JzHHS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406296AbfFKRau (ORCPT + 99 others); Tue, 11 Jun 2019 13:30:50 -0400 Received: from mail-eopbgr750077.outbound.protection.outlook.com ([40.107.75.77]:51168 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405786AbfFKR34 (ORCPT ); Tue, 11 Jun 2019 13:29:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1DqP+Z9XGiyJYY/FubOBjc7rK1Xg2and/BaFlgFZYcA=; b=BP/JzHHSUCJpCcwn2vztfEfuQ/OVqSYPidXFCjA9qV3Nks/5TSNUEqxhNC9uI0whFSyloLLP0h/UJyMFZA1WhFPiTyy3hf3JKhJaZHJeC/DTAoxJAXVOpwqTfkuxzP2flOiFQgu2C2m/taECWuhbvejsOG/kAlQuz5wcjq1bcuk= Received: from BN6PR02CA0089.namprd02.prod.outlook.com (2603:10b6:405:60::30) by DM6PR02MB4937.namprd02.prod.outlook.com (2603:10b6:5:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.14; Tue, 11 Jun 2019 17:29:53 +0000 Received: from BL2NAM02FT035.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BN6PR02CA0089.outlook.office365.com (2603:10b6:405:60::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1965.12 via Frontend Transport; Tue, 11 Jun 2019 17:29:52 +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-pvapexch02.xlnx.xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by BL2NAM02FT035.mail.protection.outlook.com (10.152.77.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.1965.12 via Frontend Transport; Tue, 11 Jun 2019 17:29:52 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Tue, 11 Jun 2019 18:29:48 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Tue, 11 Jun 2019 18:29:48 +0100 Envelope-to: arnd@arndb.de, gregkh@linuxfoundation.org, michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dragan.cvetic@xilinx.com, derek.kiernan@xilinx.com Received: from [149.199.110.15] (port=50346 helo=xirdraganc40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1hakai-0002MF-KF; Tue, 11 Jun 2019 18:29:48 +0100 From: Dragan Cvetic To: , , , , , , CC: , Dragan Cvetic , Derek Kiernan Subject: [PATCH V7 00/11] misc: xilinx sd-fec drive Date: Tue, 11 Jun 2019 18:29:34 +0100 Message-ID: <1560274185-264438-1-git-send-email-dragan.cvetic@xilinx.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain 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)(376002)(136003)(396003)(39860400002)(2980300002)(199004)(189003)(54534003)(8676002)(305945005)(246002)(356004)(50466002)(76130400001)(478600001)(36906005)(14444005)(106002)(126002)(316002)(110136005)(54906003)(956004)(28376004)(16586007)(486006)(2906002)(47776003)(2201001)(71366001)(107886003)(2616005)(476003)(44832011)(60926002)(4326008)(186003)(426003)(966005)(70586007)(336012)(6666004)(26005)(8936002)(70206006)(26826003)(36756003)(48376002)(7696005)(6306002)(51416003)(50226002)(7636002)(9786002)(5660300002)(102446001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4937;H:xir-pvapexch02.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: 537b90fe-5ed4-4146-ca51-08d6ee9269a9 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328);SRVR:DM6PR02MB4937; X-MS-TrafficTypeDiagnostic: DM6PR02MB4937: X-MS-Exchange-PUrlCount: 7 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2276; X-Forefront-PRVS: 006546F32A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 4IB/cFTabnBDxwCgjV7vMhVs1InEwxOSQhVG1bqMqEj+d9TcOmTh1CSgzROHsP5qq1XKYzglMYAExtnQs0vQM6+rGO0++BqDfAfkkcsO9W9z8FC8KJmidqlJqRNZSWaUOVWz37lBhCBy3NiHcol8EpLyf5Uv9e50VL5gvFamJnwv5qoToIraBzVXm+Q1MSRlB75TlURQWmkG9oq0wyib8XP0w1ygV/Rlfe5Mgle5giAG7kvYnwPs1vAVRS+gDmsIAtmp7zqwf7+4wBYXYcXGw2Ivy80wGFoQ3yQRqDPALds9on6ufkNcPxDna8zjwq/JbTGNLpjmEVuSjd68bhijrrgnA2MevbUXF8l0+YaHWsyPgz68KmhKXmS+X4S5f4xIkB4/JW5c6ZA2v+rf+cA27gWRMrV9ATDA8zhau1C9ndw= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2019 17:29:52.3263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 537b90fe-5ed4-4146-ca51-08d6ee9269a9 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4937 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/ Changes V3 -> V4: - Migrate to simplier misc driver - Fix DT example - Remove helper function - Remove unused open_count variable - Remove some logs - Change log level to dev_dbg in the most logs - Change spin lock to spin_lock_irqsave/spin_lock_irqrestore - Correct a licence date in xilinx_sdfec.c - Add PTR_ERR in clock handling Link to V3 patch series: https://lore.kernel.org/lkml/1556402706-176271-1-git-send-email-dragan.cvetic@xilinx.com/ Changes V4 -> V5: - change atomic variables to c type variables - align spinlock name to better description - correct a logicla error in LDPC algorithm - remove log messages - remove useless if statements - remove not needed fec_id variable - squash commit 4 with 6 Link to V4 patch series: https://lore.kernel.org/lkml/1558784245-108751-1-git-send-email-dragan.cvetic@xilinx.com/ Changes V5 -> V6: - the kernle/user space variables convert enums to __u32 - put device ID under IDR Link to V5 patch series: https://lore.kernel.org/lkml/1560038656-380620-1-git-send-email-dragan.cvetic@xilinx.com/ Changes V6 -> V7: - Fix maintainers list Link to V6 patch series: https://lore.kernel.org/lkml/1560174314-124649-1-git-send-email-dragan.cvetic@xilinx.com/ Dragan Cvetic (11): dt-bindings: xilinx-sdfec: Add SDFEC binding misc: xilinx-sdfec: add core driver misc: xilinx_sdfec: Add CCF support 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 | 9 + drivers/misc/Kconfig | 12 + drivers/misc/Makefile | 1 + drivers/misc/xilinx_sdfec.c | 1516 ++++++++++++++++++++ include/uapi/misc/xilinx_sdfec.h | 448 ++++++ 8 files changed, 2336 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 -- 2.7.4