From patchwork Fri Nov 25 05:41:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 13055538 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 E162EC4332F for ; Fri, 25 Nov 2022 05:43:39 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=+KCuikxho0tUw+RVouQCWI9DCaIK8PiRrCisqI4fJpw=; b=uN717kX6HJfP24 YYIj+rrZgeNtmCRD4m+0qbMdrPEIIglPTuzrD4fXnjUMvku2DBncU4FhDuOZvNKHcpxbJaNebKiDJ WqUEMwwG2XqwZOPAMYY34a7wT0j1jX0Lxiw4rCi/RJh0rBObE/S6z/+vGOrNhqJc+9FqPeBvQ754d pINOnWNpPSpUog89QnJSjfbQqItyW+E0tIqmjOpSeTPegrks4efobtqjGviH8ZIr3VgerxwYeM+VH yoV2Mh9PJEuoacu4F0ttRBwuSZLe8HewyvI9cgNgrWAyxpO1JLCtaj5MsQPKdhEVfpWTuM6S7SHF7 djF8HKTaF4hOFR/UeyNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRTp-00DJDL-08; Fri, 25 Nov 2022 05:42:29 +0000 Received: from mail-dm6nam12on20623.outbound.protection.outlook.com ([2a01:111:f400:fe59::623] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRTl-00DJ9q-7e for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 05:42:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KdZ9NcAITWcfjL8tOQb3vh/HZ3w0t1LS8BDzx68obEggCvobDLA/D7RnHm7q5obCHWbVnQ0+UhXDpgI3bikA0fASZgBnW1vyQEz6KxZfjWrNMwKGIzA7XnGZZTba4y/f35AGPcEzhk/7PRJoeNdtmo0ZgmVd88yfyYOWTxqe++6udrNuczqiIO6EcvGZEIpHsHgAjL78iSFoAUufef8c7156z+nclZ6aVEDOpr9NXVlYWvnE2vgLB83AVVSAfhKaSS/BebvDSPpz0rILwNXAhVJDA1XsHaHyHVx+U2ObRHzGkzZqtIB5HYdlbzwAuLz38ldOh1hMjeEF1u6ook5eeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1WxrxkOKAKISdtAr4xOiAUvdT7YfVKyssDi3LHkG5ko=; b=ilCWiZQk8IJgQ9ylyXnAlERDU4F1fuO4+NZ27TUDasG8uwkvUHqFcDpwpPV6PbRwm6j1MrLn8iz3eLa3JPcWecnUYGm0LybYl9MFhkXKTTinjAHRI/qBx/7qWxs3qrEdvQ4vYabjq794V+b1KsBpy2bC55wvFPme1djGi3oVisYhl3imxGrLfAf8scU0SV/zVfE/hB+CNjw2h8rtB98MhHqWbKb56z2Mt5o4lzRWU3sFCOnCx/CJ5lbFTaQ5bzq9n2GvhTiGjCr9YIrNUacrakG/Lo+jApDQ5vlREN8cx2QW5zwtEhNz1TGB2zRHMyOzHjjJkVCWwuYezdU/7CZ0DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1WxrxkOKAKISdtAr4xOiAUvdT7YfVKyssDi3LHkG5ko=; b=IXnjXSgJh5nt4LMAECp04S+3rdEDKKstVLiJq6LK9knht3fAbR7m+IQ+HAw8edCvo9vLwnxG88Sn3KSqxj7fXTAx7vsuym+0nEJjgLE+N34VLvW6DqXQ53CC0sAYPOFi84zkyelBCiraL+uS+DuKkHR/ECbNLOTkVn1Cz/8vWNc= Received: from BN9PR03CA0210.namprd03.prod.outlook.com (2603:10b6:408:f9::35) by MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20; Fri, 25 Nov 2022 05:42:11 +0000 Received: from BN8NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f9:cafe::4d) by BN9PR03CA0210.outlook.office365.com (2603:10b6:408:f9::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20 via Frontend Transport; Fri, 25 Nov 2022 05:42:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT030.mail.protection.outlook.com (10.13.177.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5857.17 via Frontend Transport; Fri, 25 Nov 2022 05:42:05 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 24 Nov 2022 23:41:49 -0600 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v7 1/4] dt-bindings: misc: tmr-manager: Add device-tree binding for TMR Manager Date: Fri, 25 Nov 2022 11:11:10 +0530 Message-ID: <20221125054113.122833-2-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> References: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT030:EE_|MN2PR12MB4488:EE_ X-MS-Office365-Filtering-Correlation-Id: 82fc615c-655b-4733-2e9d-08dacea7c8d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qcGQxJrOqPW8qSd7khjqBFkTHvPs6wbLsYgeHrOlTYU5bMtv317Voy4ylDGYR19+JgxxpLgZ1pWiZZ9uEf+d9KXzC4M3ETli1BHURf+HnLVeSVXWeac1n/x1rKR5o50otBoHv0nfGaUJaGtft5uiEhJ5TMlCk2VontgBbI5YC7EFk0GA8lW7Cny+dBnayIRBAQlDtLIul41HuOJS7lc17WVgI+KwuZWKX/h+s4NXuZHojnNZRwmSePgllzuC7xjqBD7sTvt0T7zPXPdtggZaHAQwUWRcOHrx6+z3BftXpnJe2xRFVLie060TRist9i7rP1eWKuZrXuvGxRfHjd5LHiyMJSKIS0x5Zp69nR5PSlY5RKFvIiXMHKg7v/UuT11MRRQBI5J3e8TxX1QFk5tWpnLBh6N8FndC/h+tRSu0lEUPdUnVWDC9huiFdpAEIM/RvIUOCOaqhZq30dwP73RVK13mmjFd39JlFYOC51G6Jz5/KMGNXAx7n/YJDIRfwJqWrKgOPIh1dTv4NrFO2B+rbo19+iUgIuc4JSS0uuD/ytA3yJQUe5u6WWvhXQhzvGjOih3llevYA1Tbc7CBBtCH4ZOMhrmm8wIv57JrDjePKHbYTXceL37si3kxawhgQjfC0D2VlDPWIab1sT2iK7kyLZm2xbTIm8LdostS2w+xyGYI9D88NIdodohJ7xUhtixSfdmu43+rBxptMVjl4pmEsJrNrqKvcCSl2MHQ/z1YumGg5OJQ6ISgQOaWzzyzba9cyG4n3JNHrrejctvo3r9zgXqbkV5G/I4GIZbR2JtewIZCp7bHRHJPWZSoUK6TzX7uLaOx/E+qRuvbgg/txjtgUg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199015)(46966006)(40470700004)(36840700001)(966005)(478600001)(186003)(16526019)(82310400005)(426003)(41300700001)(2616005)(1076003)(316002)(54906003)(103116003)(40460700003)(82740400003)(36756003)(6666004)(40480700001)(110136005)(26005)(86362001)(4326008)(70586007)(921005)(70206006)(8676002)(5660300002)(8936002)(336012)(356005)(81166007)(47076005)(83380400001)(2906002)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 05:42:05.0152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82fc615c-655b-4733-2e9d-08dacea7c8d5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4488 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_214225_316761_09DE5015 X-CRM114-Status: GOOD ( 14.96 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Triple Modular Redundancy(TMR) subsystem contains three microblaze cores, subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. TMR Manager is responsible for performing recovery of the subsystem detects the fault via a break signal it invokes microblaze software break handler which calls the tmr manager driver api to update the error count and status. Signed-off-by: Appana Durga Kedareswara rao Reviewed-by: Krzysztof Kozlowski --- Changes for v7: --> None. Changes for v6: --> None. Changes for v5: --> None. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal. .../bindings/misc/xlnx,tmr-manager.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml diff --git a/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml b/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml new file mode 100644 index 000000000000..27de12147a52 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/xlnx,tmr-manager.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Triple Modular Redundancy(TMR) Manager IP + +maintainers: + - Appana Durga Kedareswara rao + +description: | + The Triple Modular Redundancy(TMR) Manager is responsible for handling the + TMR subsystem state, including fault detection and error recovery. The core + is triplicated in each of the sub-blocks in the TMR subsystem, and provides + majority voting of its internal state. + +properties: + compatible: + enum: + - xlnx,tmr-manager-1.0 + + reg: + maxItems: 1 + + xlnx,magic1: + minimum: 0 + maximum: 255 + description: + Magic byte 1, When configured it allows the controller to perform + recovery. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - xlnx,magic1 + +additionalProperties: false + +examples: + - | + tmr-manager@44a10000 { + compatible = "xlnx,tmr-manager-1.0"; + reg = <0x44a10000 0x10000>; + xlnx,magic1 = <0x46>; + }; From patchwork Fri Nov 25 05:41:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 13055539 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 D01EBC433FE for ; Fri, 25 Nov 2022 05:44:23 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=mW4lTCmeOJLye7p94SgHCcRIErDWhTuVa1bSKdRapeA=; b=AOXnWwA/GgSjxZ lCFkB0QMqITeQOuFyE6Yb/fHaYHiqjB/BIAPkMRdqBHBprP1iuvNxY+o5CH/+1w9K6+aD36xL1buP 7H6DcHp2BxLx9lAb4XmIV51Y/lyAi7GCQC8ligv8b+VBReH5x5y9TOcE1X7nRdH32oheJGlihySrx FvuPqrdGs4P+FtXDW3GHxR7mDCi3+GMcN5PcEdTzj0nbUtw3A+rtlPu4VsN5B8sT7umwy0gymrjHg Di1zr9zFMliZ4L6YeFnBSesYtqtT+o3a4tmT5tu8BxZg1e4vMGBffneBWPJsBfacPRl3816N0ZKd1 IE6QkS1fxLTuQrUEwb0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRUV-00DJXl-Qk; Fri, 25 Nov 2022 05:43:12 +0000 Received: from mail-mw2nam10on2061d.outbound.protection.outlook.com ([2a01:111:f400:7e89::61d] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRUM-00DJTO-JW for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 05:43:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X8vJ6nGfME5I0SfNL4qa5sJ+Ehknvzy8Ut/2PxZ5mdrvnRbAAAWJcwXMbdht6HwYBo/o+J5EdovU0GDY3jVLHTz0GzejdvWjDozhwdcKRyVk+0A5uvMUh3Ln4EtzLyLdm7M81uNqyotc3VJvcYYCNvFQE5zdVjaCxnz1p+WEBBYRAo57Ur1Ot0d6HssuMdttHH5JxwnznSpY89czXg5i7S+1Azo4jcn0hV/0XuryO4NJ1IRt1iefbkFXMom5x5KWFOY9IxNDx/OEOOUOa+hlWV5d4pV4AIULm4Osh9i2/CN5FMRMQeQlq/8dQnTSzjakzEm2jc+yrSgV+zGr4LHY/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/oKqB+kGjLjjIICoBTmdWwaZ3pmRc2pojxvQBlfy+kI=; b=BIILFUM5Ttc1GjZTVbDuLOypfFJm9ai+zGSJfFZM6UpmdEo33PVHu42adatBUl8qytofV8v/PZ/dRblW7WHZmPe8mQSDyDtnvxv77FG26lIGO+GZI1ZA6rrUlFFc++9xt6dGm4CkVKkzMhIWYy6+5jUf8wt5OsxehAubWKQeqLvGTF02VaDlOpmOVQaSgy7z3A2JfEuItYxhbF8DIHd5niYowbV1mOFEAFKG2bJRcdcHf4i2ZbHW9eW8TBHH+W5pgVlS5uvmBrq71gUnHeO/sS7TacoJA38pHa+kfRGdXwP9IUuvvQgEZwbOfqCDeEHtxy7vzbDFkRc4prCHP0z75w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/oKqB+kGjLjjIICoBTmdWwaZ3pmRc2pojxvQBlfy+kI=; b=CLR89drsbtWkHosLaDz5e/l0LCA9wBlJEDwgXEDcPkMuHKPdw+reizjLLbQm5VYS7GhW79+E5hsfj2UhGEWD/5PuOpwD+gBOgEiyejn0IUlMWBF4UTre/8DbrcyWeKFmo+5W8yWGt1cGGDoN7DCMpcfKhKE1UlkJqgQ+rcYIUJI= Received: from BN9PR03CA0235.namprd03.prod.outlook.com (2603:10b6:408:f8::30) by DS7PR12MB5718.namprd12.prod.outlook.com (2603:10b6:8:71::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Fri, 25 Nov 2022 05:42:56 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::22) by BN9PR03CA0235.outlook.office365.com (2603:10b6:408:f8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19 via Frontend Transport; Fri, 25 Nov 2022 05:42:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Fri, 25 Nov 2022 05:42:56 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 24 Nov 2022 23:42:05 -0600 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v7 2/4] drivers: misc: Add Support for TMR Manager Date: Fri, 25 Nov 2022 11:11:11 +0530 Message-ID: <20221125054113.122833-3-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> References: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT024:EE_|DS7PR12MB5718:EE_ X-MS-Office365-Filtering-Correlation-Id: c03355f1-ba24-47c3-3951-08dacea7e78f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 67rKFKOMk6wozoHVsdBG7Y0bhYYlLQkWhFoHbBu0m0+nbAHdbcYIdbm3wjSuRF7r3oMBNRVUNR3EFHnii1+fi5LmgDyPmPpXb2KRC3Iy14GU13OVCz5c6qP3BjDkqOLiIX2A7ZS+mbwuAEadGSqWqXCxX7tgqJR0DYFOAU1J9ohSd8y91d8ehS4lwZFoCjeGkA0+FFsn4VQzjUAOyW5tZtTW6daIgDSD+0Yq6Z3BSVDj0H7A9h1WAkntYP3bZT2dEWb3aYewcemJB1oMsID4wTkEd4BcXmfGlZoBP4dCnlvgLFSkkGeHSh3HgTYWjVl9SbIjsY8B2E64S7yIYUo2SfTF0Z/SXm/fRzZL+7aa7A/w4Cz1cKJ/iim9Q/59JGZA1C6Al+afhnmSmyFlAulOpy8C32NCpZvG65uMHEDIUffKjyKLd6iqPa1dnkWh16w2SotJXWENigME3JHrIciZpSupJAImWjfq384KxYj/4/PsOZvqAx0AyuBlrIJD/jw9yaup/xRIKOlDx1B0EVtAerSMXXAsH9qWIcIndK938aIlml8a7Jly5+IMuhNYMiY5ICDNcUTng5cr7hhWkeGjFIS9eMApbG3bK186xq+SqsZPUk9cAJr56ZvVBg48pfDAOspu+bDhtLCCOJF23vocO5VvUhvJrf1cQHxqr7AedikpNMgiNy1lJplo2qdbEg0F+9A5lAz9wNwwx5n7IjIGl7RKB7Ygx4M5drh6Vu5c2/xLpAzF6t8hlycySZHg4T22NTdjLfGlNYJvbwYEqRedqQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(40480700001)(110136005)(478600001)(54906003)(966005)(26005)(316002)(6666004)(70586007)(5660300002)(82740400003)(426003)(4326008)(1076003)(336012)(30864003)(2616005)(86362001)(83380400001)(8936002)(186003)(41300700001)(16526019)(103116003)(47076005)(70206006)(36756003)(2906002)(36860700001)(8676002)(40460700003)(82310400005)(81166007)(356005)(921005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 05:42:56.5661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c03355f1-ba24-47c3-3951-08dacea7e78f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5718 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_214302_743543_F0387C47 X-CRM114-Status: GOOD ( 27.46 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Triple Modular Redundancy(TMR) subsystem contains three microblaze cores, subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. TMR Manager is responsible for performing recovery of the subsystem detects the fault via a break signal it invokes microblaze software break handler which calls the tmr manager driver api to update the error count and status, added support for fault detection feature via sysfs interface. Usage: To know the break handler count(Error count): cat /sys/devices/platform/amba_pl/44a10000.tmr_manager/errcnt Signed-off-by: Appana Durga Kedareswara rao --- Changes for v7: --> Removed the reported-by kernel test robot from the commit message and update the change log description for the same in the corresponding patch version, rebased patch on top of torvalds master branch. Changes for v6: --> None. Changes for v5: --> Fixed Unexpected indentation htmldoc warning in sysfs-driver-xilinx-tmr-manager reported by kernel test robot. --> Removed sysfs references from the Kconfig description. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal. .../testing/sysfs-driver-xilinx-tmr-manager | 16 ++ MAINTAINERS | 7 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 1 + drivers/misc/xilinx_tmr_manager.c | 220 ++++++++++++++++++ 5 files changed, 254 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager create mode 100644 drivers/misc/xilinx_tmr_manager.c diff --git a/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager new file mode 100644 index 000000000000..57b9b68a73ee --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager @@ -0,0 +1,16 @@ +What: /sys/devices/platform/amba_pl//errcnt +Date: Nov 2022 +Contact: appana.durga.kedareswara.rao@amd.com +Description: This control file provides the fault detection count. + This file cannot be written. + Example: + # cat /sys/devices/platform/amba_pl/44a10000.tmr_manager/errcnt + 1 + +What: /sys/devices/platform/amba_pl//dis_block_break +Date: Nov 2022 +Contact: appana.durga.kedareswara.rao@amd.com +Description: Write any value to it, This control file enables the break signal. + This file is write only. + Example: + # echo > /sys/devices/platform/amba_pl/44a10000.tmr_manager/dis_block_break diff --git a/MAINTAINERS b/MAINTAINERS index c962415d962c..5f0344f14192 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13422,6 +13422,13 @@ W: http://www.monstr.eu/fdt/ T: git git://git.monstr.eu/linux-2.6-microblaze.git F: arch/microblaze/ +MICROBLAZE TMR MANAGER +M: Appana Durga Kedareswara rao +S: Supported +F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager +F: Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml +F: drivers/misc/xilinx_tmr_manager.c + MICROCHIP AT91 DMA DRIVERS M: Ludovic Desroches M: Tudor Ambarus diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 358ad56f6524..a61445008f9e 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -496,6 +496,16 @@ config VCPU_STALL_DETECTOR If you do not intend to run this kernel as a guest, say N. +config TMR_MANAGER + tristate "Select TMR Manager" + depends on MICROBLAZE && MB_MANAGER + help + This option enables the driver developed for TMR Manager. + The Triple Modular Redundancy(TMR) manager provides support for + fault detection. + + Say N here unless you know what you are doing. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index ac9b3e757ba1..b93b782a52f4 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -62,3 +62,4 @@ obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o obj-$(CONFIG_OPEN_DICE) += open-dice.o obj-$(CONFIG_GP_PCI1XXXX) += mchp_pci1xxxx/ obj-$(CONFIG_VCPU_STALL_DETECTOR) += vcpu_stall_detector.o +obj-$(CONFIG_TMR_MANAGER) += xilinx_tmr_manager.o diff --git a/drivers/misc/xilinx_tmr_manager.c b/drivers/misc/xilinx_tmr_manager.c new file mode 100644 index 000000000000..0ef55e06d3a0 --- /dev/null +++ b/drivers/misc/xilinx_tmr_manager.c @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Driver for Xilinx TMR Manager IP. + * + * Copyright (C) 2022 Advanced Micro Devices, Inc. + * + * Description: + * This driver is developed for TMR Manager,The Triple Modular Redundancy(TMR) + * Manager is responsible for handling the TMR subsystem state, including + * fault detection and error recovery. The core is triplicated in each of + * the sub-blocks in the TMR subsystem, and provides majority voting of + * its internal state provides soft error detection, correction and + * recovery. + */ + +#include +#include +#include + +/* TMR Manager Register offsets */ +#define XTMR_MANAGER_CR_OFFSET 0x0 +#define XTMR_MANAGER_FFR_OFFSET 0x4 +#define XTMR_MANAGER_CMR0_OFFSET 0x8 +#define XTMR_MANAGER_CMR1_OFFSET 0xC +#define XTMR_MANAGER_BDIR_OFFSET 0x10 +#define XTMR_MANAGER_SEMIMR_OFFSET 0x1C + +/* Register Bitmasks/shifts */ +#define XTMR_MANAGER_CR_MAGIC1_MASK GENMASK(7, 0) +#define XTMR_MANAGER_CR_MAGIC2_MASK GENMASK(15, 8) +#define XTMR_MANAGER_CR_RIR_MASK BIT(16) +#define XTMR_MANAGER_FFR_LM12_MASK BIT(0) +#define XTMR_MANAGER_FFR_LM13_MASK BIT(1) +#define XTMR_MANAGER_FFR_LM23_MASK BIT(2) + +#define XTMR_MANAGER_CR_MAGIC2_SHIFT 4 +#define XTMR_MANAGER_CR_RIR_SHIFT 16 +#define XTMR_MANAGER_CR_BB_SHIFT 18 + +#define XTMR_MANAGER_MAGIC1_MAX_VAL 255 + +/** + * struct xtmr_manager_dev - Driver data for TMR Manager + * @regs: device physical base address + * @cr_val: control register value + * @magic1: Magic 1 hardware configuration value + * @err_cnt: error statistics count + * @phys_baseaddr: Physical base address + */ +struct xtmr_manager_dev { + void __iomem *regs; + u32 cr_val; + u32 magic1; + u32 err_cnt; + resource_size_t phys_baseaddr; +}; + +/* IO accessors */ +static inline void xtmr_manager_write(struct xtmr_manager_dev *xtmr_manager, + u32 addr, u32 value) +{ + iowrite32(value, xtmr_manager->regs + addr); +} + +static inline u32 xtmr_manager_read(struct xtmr_manager_dev *xtmr_manager, + u32 addr) +{ + return ioread32(xtmr_manager->regs + addr); +} + +static void xmb_manager_reset_handler(struct xtmr_manager_dev *xtmr_manager) +{ + /* Clear the FFR Register contents as a part of recovery process. */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_FFR_OFFSET, 0); +} + +static void xmb_manager_update_errcnt(struct xtmr_manager_dev *xtmr_manager) +{ + xtmr_manager->err_cnt++; +} + +static ssize_t errcnt_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); + + return sysfs_emit(buf, "%x\n", xtmr_manager->err_cnt); +} +static DEVICE_ATTR_RO(errcnt); + +static ssize_t dis_block_break_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t size) +{ + struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); + int ret; + long value; + + ret = kstrtoul(buf, 16, &value); + if (ret) + return ret; + + /* unblock the break signal*/ + xtmr_manager->cr_val &= ~(1 << XTMR_MANAGER_CR_BB_SHIFT); + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, + xtmr_manager->cr_val); + return size; +} +static DEVICE_ATTR_WO(dis_block_break); + +static struct attribute *xtmr_manager_dev_attrs[] = { + &dev_attr_dis_block_break.attr, + &dev_attr_errcnt.attr, + NULL, +}; +ATTRIBUTE_GROUPS(xtmr_manager_dev); + +static void xtmr_manager_init(struct xtmr_manager_dev *xtmr_manager) +{ + /* Clear the SEM interrupt mask register to disable the interrupt */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_SEMIMR_OFFSET, 0); + + /* Allow recovery reset by default */ + xtmr_manager->cr_val = (1 << XTMR_MANAGER_CR_RIR_SHIFT) | + xtmr_manager->magic1; + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, + xtmr_manager->cr_val); + /* + * Configure Break Delay Initialization Register to zero so that + * break occurs immediately + */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_BDIR_OFFSET, 0); + + /* + * To come out of break handler need to block the break signal + * in the tmr manager, update the xtmr_manager cr_val for the same + */ + xtmr_manager->cr_val |= (1 << XTMR_MANAGER_CR_BB_SHIFT); + + /* + * When the break vector gets asserted because of error injection, + * the break signal must be blocked before exiting from the + * break handler, Below api updates the TMR manager address and + * control register and error counter callback arguments, + * which will be used by the break handler to block the + * break and call the callback function. + */ + xmb_manager_register(xtmr_manager->phys_baseaddr, xtmr_manager->cr_val, + (void *)xmb_manager_update_errcnt, + xtmr_manager, (void *)xmb_manager_reset_handler); +} + +/** + * xtmr_manager_probe - Driver probe function + * @pdev: Pointer to the platform_device structure + * + * This is the driver probe routine. It does all the memory + * allocation for the device. + * + * Return: 0 on success and failure value on error + */ +static int xtmr_manager_probe(struct platform_device *pdev) +{ + struct xtmr_manager_dev *xtmr_manager; + struct resource *res; + int err; + + xtmr_manager = devm_kzalloc(&pdev->dev, sizeof(*xtmr_manager), + GFP_KERNEL); + if (!xtmr_manager) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + xtmr_manager->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(xtmr_manager->regs)) + return PTR_ERR(xtmr_manager->regs); + + xtmr_manager->phys_baseaddr = res->start; + + err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic1", + &xtmr_manager->magic1); + if (err < 0) { + dev_err(&pdev->dev, "unable to read xlnx,magic1 property"); + return err; + } + + if (xtmr_manager->magic1 > XTMR_MANAGER_MAGIC1_MAX_VAL) { + dev_err(&pdev->dev, "invalid xlnx,magic1 property value"); + return -EINVAL; + } + + /* Initialize TMR Manager */ + xtmr_manager_init(xtmr_manager); + + platform_set_drvdata(pdev, xtmr_manager); + + return 0; +} + +static const struct of_device_id xtmr_manager_of_match[] = { + { + .compatible = "xlnx,tmr-manager-1.0", + }, + { /* end of table */ } +}; +MODULE_DEVICE_TABLE(of, xtmr_manager_of_match); + +static struct platform_driver xtmr_manager_driver = { + .driver = { + .name = "xilinx-tmr_manager", + .of_match_table = xtmr_manager_of_match, + .dev_groups = xtmr_manager_dev_groups, + }, + .probe = xtmr_manager_probe, +}; +module_platform_driver(xtmr_manager_driver); + +MODULE_AUTHOR("Advanced Micro Devices, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Manager Driver"); +MODULE_LICENSE("GPL"); From patchwork Fri Nov 25 05:41:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 13055540 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 976ACC433FE for ; Fri, 25 Nov 2022 05:45:13 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=4b+Y1YkyJ4xut4OZO+GZIGOwDF8uVrECZun+1v6bPpQ=; b=1qQi6BYzp03LLM JjU5ckhGJXlRz0YSj3//n83SOpf7JTxUhzwfpDlxiaR5kfTB7FTf5XjyQoOg+aj8f1rLWxSA/4oTg USJS4GJbQJGI6rNkC/WK9voX4bjSKju2KQb6SZ4IHYgqzNGPrFJLmGEg/wcWIT1ZQxaRkc3FXxc7J 7xmYtFwHp4mrsz3M01qTJ49n3n4jqkbrDJdw6RpUzugmxXhrAvukCQvTDzpFALiOfoJJm/nkIBviI VGb0MY4oqPObUHSSvLm+UJGMpsXXaBLzwNlPYzaZpQSN/+dilc00dlL3Pb+w2vUg9IAZVF3sJIMYP O57EWAN/+lEAM7fVr/iQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRV4-00DJlr-EI; Fri, 25 Nov 2022 05:43:47 +0000 Received: from mail-bn7nam10on20608.outbound.protection.outlook.com ([2a01:111:f400:7e8a::608] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRUP-00DJV5-UG for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 05:43:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OfsNBynDErtUQUXTRwqfOpowU1Jj6t0PI4p6L4SVwQwWUXrRs7u/G2k12aYQBYPG/1UZMbT/OXxfx5Ur9S6wqtjCS7V8N02BXEArOUJbLbvCUlbjb/o+l+9ILePkEnCImMT3AuQXIHOrbAz9e/hHrAGOk7BAF4/3TcmjJyvx99xZowuEhxyN+sW4gMkCCoChrA0AULJNlS/tgto9wGg9nacwNF+H58ZSin1d/JsNV7cTLdZ9AU4daUzDtFdpSddXLzavvSVUrifU1gnQCHo49f0o3mIP/KF4MsZ0cJNRZNgI6T6sjLxab0QRWCUSf0u/4cpS2wbpX+UKw2fzFZJ9cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T7Dqr/FDyy4ZhZQgBLuPQvIMlpwgCxwTdGnA4gzrUDw=; b=JygeaQeH31hJ31FVJ989wkJDWNO+DyM9J/tcOc7nvrOK4WNe2mEVasPHOn5VOIlvMZipA4rJ59gY6XXEGiKmOL+8O+F3eyOVFbHuWR7aZvsG9ciCC99cxbV6UOiBQqwAF48bErazV1C1bYttlTeANmjG97XYgRKFR3gwXca9/8bAyqUzTmNab+Bcx5ZPLdyigvmrG+08wAlLEG2ELcVVlBmygXl6ox3TuBg5IygyN+CZloDwy+KZvD7bT21SQzjjCA9y+xO1UWDHtxDlJFgjyAt/huWFFHrMQ3HbnbOWcRfeS3DQUqL28Bfm7Bc3Dn7w/wB6hkUL/gy2IvfgVAqPcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T7Dqr/FDyy4ZhZQgBLuPQvIMlpwgCxwTdGnA4gzrUDw=; b=UgT9Q+wmbz3am8Wm/qK5DUTJN/j2t0g7M28UyC3T52LodVu/QnGs588OJqzhxOfwdDEtCkBoBSLhj6TzgJBNLSG1y0OKLaXkooyqfji4wsCrF0yjftx95DFAQ1NTTwioR2E+QqwUvxaeSJwcnFdoPEZYVq3uE9Dy0M3MEYeU+94= Received: from BN9PR03CA0237.namprd03.prod.outlook.com (2603:10b6:408:f8::32) by PH7PR12MB7233.namprd12.prod.outlook.com (2603:10b6:510:204::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Fri, 25 Nov 2022 05:42:58 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::20) by BN9PR03CA0237.outlook.office365.com (2603:10b6:408:f8::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19 via Frontend Transport; Fri, 25 Nov 2022 05:42:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Fri, 25 Nov 2022 05:42:58 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 24 Nov 2022 23:42:57 -0600 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v7 3/4] dt-bindings: misc: tmr-inject: Add device-tree binding for TMR Inject Date: Fri, 25 Nov 2022 11:11:12 +0530 Message-ID: <20221125054113.122833-4-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> References: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT024:EE_|PH7PR12MB7233:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f903e60-3ad5-406e-12b6-08dacea7e8b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rhONuJ5BpiCecfVG8Bic5yR8aj1nqMlvqZjlzsyZzZ20FcSX8lnoZzoUfuNjro5mCkqTCEZ3kiHZsXc8dr7vz5jZEw3EDHKsedh0DwglL19Bj6WfgWf6gS8mLdkNGpx2Yn+YTcmBeJLJzatMBYraZRIsN8VBhJ1PlGdZZGRUQRNYEP8u7ZVCE5NsUpYPHJK54AULNajCBkRYJuI/LohOS/fDE8cYTDfQgP07JAWkABKPrZ7a4XoNQmHKFRadtGQNEjR3xjQRXuXB6wZKMvuEDtd021Q8rafI//8cZWBOIe44RfAU6Bk9ewzDuuu6tw40WarV9Bd8iEizLNcNKMJ06mOmGICKcJR5MIR9jEfYpTxIRm6ZFkF//gkOApsLgJHNZp8QKZnaq5cLP46zN/xavTklxWpH9IO60r+0Npp+sMykGd2rIdAXR88aYrpsC3eOvVop2PL7ADGdiIeEtQ/76okSRLOhIJC/bX3x9JE0a9mWhQAFJLZ/cUNj8Ky7q03FKJLBl0eiiuWydxNmjM4E9XTJRVZmmGGdg8olHybI4P4bwuvTfMT9Q4jsueQ3/VU95g0P+yiCTVWh2eAfCxqKl6GZRigiMDbEEy+x3O9Cl4xC49GyLXYTL0Po71/Ev1CVNi87n2C9vX7NqkYZU28h3jkY49zsiHuT6bNhGKR/EU56SxnV6blo6X+ZUMWcVNpI+6LCXT5fKE7csJREyLHKFBKDx+vSJWUT6UpMapGuZ/TX23sPHdNLSGuykHl/yceZufEYyMzFhVaxOpNXEyP8cD2Jcaw7WmTNkpXUnSzsN4HmRufkEQ6gjW2bXhQftc0w60S/eViJrdtuG7uD1x1Rmw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199015)(46966006)(36840700001)(40470700004)(356005)(478600001)(103116003)(40480700001)(81166007)(921005)(966005)(36756003)(336012)(16526019)(426003)(5660300002)(40460700003)(6666004)(1076003)(83380400001)(26005)(186003)(2616005)(86362001)(36860700001)(47076005)(8936002)(41300700001)(2906002)(82740400003)(70206006)(110136005)(82310400005)(54906003)(8676002)(4326008)(70586007)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 05:42:58.4878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f903e60-3ad5-406e-12b6-08dacea7e8b2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_214305_999403_82C67A52 X-CRM114-Status: GOOD ( 13.91 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Triple Modular Redundancy(TMR) Inject core provides functional fault injection by changing selected MicroBlaze instructions, which provides the possibility to verify that the TMR subsystem error detection and fault recovery logic is working properly. Signed-off-by: Appana Durga Kedareswara rao Reviewed-by: Krzysztof Kozlowski --- Changes for v7: --> None. Changes for v6: --> None. Changes for v5: --> None. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal. .../bindings/misc/xlnx,tmr-inject.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml diff --git a/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml b/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml new file mode 100644 index 000000000000..1b6020e4ec27 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/xlnx,tmr-inject.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Triple Modular Redundancy(TMR) Inject IP + +maintainers: + - Appana Durga Kedareswara rao + +description: | + The Triple Modular Redundancy(TMR) Inject core provides functional fault + injection by changing selected MicroBlaze instructions, which provides the + possibility to verify that the TMR subsystem error detection and fault + recovery logic is working properly. + +properties: + compatible: + enum: + - xlnx,tmr-inject-1.0 + + reg: + maxItems: 1 + + xlnx,magic: + minimum: 0 + maximum: 255 + description: | + Magic number, When configured it allows the controller to perform + recovery. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - xlnx,magic + +additionalProperties: false + +examples: + - | + fault-inject@44a30000 { + compatible = "xlnx,tmr-inject-1.0"; + reg = <0x44a10000 0x10000>; + xlnx,magic = <0x46>; + }; From patchwork Fri Nov 25 05:41:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 13055541 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 C0147C4332F for ; Fri, 25 Nov 2022 05:45:48 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=Y5SMwVDn5iuVJCDSipjf33jah1JEX0hW260Ipov35vg=; b=oAWbZQjPxYs+xX kM8ITM67uUxXM30vocaPDPfCedthj8snj0jhc5dKKHSKBeioNO2GmXQ8x9AX4HFZ39HWUlQa13TSE pQ+lniCBNN+P3xPDO8Evmn5mFd1ex4ApQApUQmlJWxR7RxWToxweWBEaJvLDMKyHbuA71PtUfgClG M3/CV7n5c/6SvYW+lIJ4BirvHFM2jAL0gIQOEPt02M4rCsS8OmT+/kZ/F/iIuPbUj5AzbiSsrNfUD ZJyrzvcdGKV4OmMPDmNCbEhMpIcZrQfX/Y0iLKQ4o6QXsXY+x7iV90MaRBTI/w47pktsRi1nvRZ9t 54ry++2QbdK5xooK1ZYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRVR-00DJus-Fh; Fri, 25 Nov 2022 05:44:09 +0000 Received: from mail-mw2nam12on20609.outbound.protection.outlook.com ([2a01:111:f400:fe5a::609] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyRUR-00DJXI-Nu for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 05:43:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SK6W7gJhxsV6kxoaWG9xMtNjugbe0UlkqcDywzYMa8QBadLme04AoOyPLgKUPn66t/BrU54FNm0Vtqn1EAzITzfL9osp/aMJTu4L9cTWmLjCVtgsmPzEVdjCrsM7h3qjaTKfzHFZK6sxHG6+GVOxPz4cddC4RV0/KjU9QpwgAKUmbuOJ6KlTqATomAAGGlloCboamrnBgd+cVcbkyB4uSYDY1ZafQ6NWDS6wUUhuIXw8IRk4SbVjTBVPyyUXmnw5up6stUrDrvL+dGmLw94KSY6b6J1X2batfwLk0aQmgK9/GwqlUdwa5fyN92pbbTHyWceDlL2YydIyNC98y/ticw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UH2DRh2I6ViNFJsUc1g1Y/GfIp8QSxvxMldoZSbDftc=; b=g1tste354TLtLpn9uPpIk2P4l9K4yWDor6xVq3+XoVtZ8cJB5cB5Dcuxbg4ahoi/4HHFFBcPhA5juvbWHrehXEbbEa+I81UFgRh/Fymp5TcM5t36SkQ7uQqU2jBhIpHQQob5BkQ5tFE5t0Pg/PiMUFTjCnZmEHX5G8b7xpdhKaLVoGyFWPTyU3yL6/OIf267nAWI/sTiudJM/L2XKqZJQzr1mvDDVmDT7MbJnfJeoM95BX5vu5aOgeOpXG7UpxXoMr9TBcBGLBJHxee/vt7YudekijnDNbjqOKHTXdgunK2H3E/uNvzc48YPyMHI4Hm/tWPCXbD7TKB2Afq/HMJM2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UH2DRh2I6ViNFJsUc1g1Y/GfIp8QSxvxMldoZSbDftc=; b=KQM1xXYzcpgeZYpGMdsV0vv6ULnXGQqeUujB3hIJEM7a0O/o6+Sop6MF8nOwK3eDApKnA4XaP6resAUlwWaER18IRt6ZJ7VktchfArzo1lqiGuWcdxBxdBqFhqSr6r/SrhYRuF785RH+AzPKcDQ01y87RmDy/yR39bOxU0MGxSE= Received: from BN9PR03CA0234.namprd03.prod.outlook.com (2603:10b6:408:f8::29) by MN0PR12MB6125.namprd12.prod.outlook.com (2603:10b6:208:3c7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Fri, 25 Nov 2022 05:43:02 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::1b) by BN9PR03CA0234.outlook.office365.com (2603:10b6:408:f8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20 via Frontend Transport; Fri, 25 Nov 2022 05:43:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Fri, 25 Nov 2022 05:43:02 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 24 Nov 2022 23:43:00 -0600 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v7 4/4] drivers: misc: Add Support for TMR Inject IP Date: Fri, 25 Nov 2022 11:11:13 +0530 Message-ID: <20221125054113.122833-5-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> References: <20221125054113.122833-1-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT024:EE_|MN0PR12MB6125:EE_ X-MS-Office365-Filtering-Correlation-Id: 12888818-8aca-47f6-dbff-08dacea7eacc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Y55Kb8N7r5BHJ4RnlDC98WvPGifZzyBgdZF7URNuNODKDNUXEL1ub1ZyGTZbbFRMWN+xUOV3PVXOz7ZKbWHcHebLvJA/cFEoa5XzDsrLPQy3dXKgh97Co1ehRgbP7G4oSD0taZhlvu3DUweoSzgUCJSq3Xk3UpIbxtcC3McPCXYCX5SkCrSJroVSC+Ygraedv8C7ogLMfue5e597gg9TZ9tHicpcDm1Xg3etJOKQXo5UPvWQlr2MyxMf7E0AK07lk9Jimss0uz61iSMS36WI9ktwHvdXMd8kLBsmXl2k0Uf0PU1WgVrnIS0IjeHz3GcHFYi59mgDXaL/nnf5kL1Kyna5ZKoAD7OCDk3KY2MnsE8vxsjXyOmJZFOKSZxxdRQP/jRoeFtu0K3fsZFZN2bLSdNUA6jHeNkSDLQEdSXO1MDVPkP/75cU0cbcfjboNnvxtNzHOe9qToUBSb8LvDroRfTlS8OAZT9xAf2f+KaVBQEAxTVi6esJkjS40sn4JR4QrA4+EgdBBXE6a/qAOt/uiRTHA4LEyMS8YbSpdsafzdkc5myOc2f7MqevpYO4Nn9m3yXrCKPbKb2dNa834+ZQt0iDaxMAgb/97HvhEgaupmgrcf7btvbUP99CWpmVKI1nvhSCznG5r20rE1Ks0KgqtBJN9AoFoEK1CmF6F/RaSKSJYi4Usr3lbPStHGfU/ShYQ89+8brmmn7cbxQatGgaWGa1wJ3GAbvruZjSNJQpDdNhIgSST1g4Ens9DhWb7Ag X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199015)(36840700001)(46966006)(40470700004)(103116003)(36756003)(921005)(82740400003)(41300700001)(81166007)(8676002)(356005)(426003)(83380400001)(2906002)(36860700001)(86362001)(47076005)(316002)(1076003)(26005)(70206006)(4326008)(70586007)(336012)(186003)(110136005)(16526019)(54906003)(5660300002)(40460700003)(40480700001)(8936002)(6666004)(2616005)(82310400005)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 05:43:02.0188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12888818-8aca-47f6-dbff-08dacea7eacc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6125 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_214307_928321_AE69E25A X-CRM114-Status: GOOD ( 32.60 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Triple Modular Redundancy(TMR) provides functional fault injection by changing selected MicroBlaze instructions, which provides the possibility to verify that the TMR subsystem error detection and fault recovery logic is working properly. Usage: echo 1 > /sys/kernel/debug/xtmr_inject/inject_fault/inject_fault Signed-off-by: Appana Durga Kedareswara rao --- Changes for v7: --> Removed the reported-by kernel test robot from the commit message and update the change log description for the same in the corresponding patch version, rebased patch on top of torvalds master branch. Changes for v6: --> Fixed -Wmissing-prototypes warning reported by kernel test robot. Changes for v5: --> None. Changes for v4: --> Update depends on with FAULT_INJECTION_DEBUG_FS instead of FAULT_INJECTION. Changes for v3: --> Updated the driver to use fault-injection api as suggested by Greg. --> Updated the Kconfig to compile the driver as a module. Changes for v2: --> Fixed Month in the sysfs description. --> Fixed line over 80 char in driver. --> Replaced kstrtol with kstrtoul as suggested by Michal. --> Added error check for xlnx,magic value. MAINTAINERS | 6 ++ drivers/misc/Kconfig | 10 ++ drivers/misc/Makefile | 1 + drivers/misc/xilinx_tmr_inject.c | 171 +++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 drivers/misc/xilinx_tmr_inject.c diff --git a/MAINTAINERS b/MAINTAINERS index 5f0344f14192..6dd1a3491946 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13429,6 +13429,12 @@ F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager F: Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml F: drivers/misc/xilinx_tmr_manager.c +MICROBLAZE TMR INJECT +M: Appana Durga Kedareswara rao +S: Supported +F: Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml +F: drivers/misc/xilinx_tmr_inject.c + MICROCHIP AT91 DMA DRIVERS M: Ludovic Desroches M: Tudor Ambarus diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index a61445008f9e..35a5d333fc37 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -506,6 +506,16 @@ config TMR_MANAGER Say N here unless you know what you are doing. +config TMR_INJECT + tristate "Select TMR Inject" + depends on TMR_MANAGER && FAULT_INJECTION_DEBUG_FS + help + This option enables the driver developed for TMR Inject. + The Triple Modular Redundancy(TMR) Inject provides + fault injection. + + Say N here unless you know what you are doing. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index b93b782a52f4..b2d8dd39f4d5 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -63,3 +63,4 @@ obj-$(CONFIG_OPEN_DICE) += open-dice.o obj-$(CONFIG_GP_PCI1XXXX) += mchp_pci1xxxx/ obj-$(CONFIG_VCPU_STALL_DETECTOR) += vcpu_stall_detector.o obj-$(CONFIG_TMR_MANAGER) += xilinx_tmr_manager.o +obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inject.c new file mode 100644 index 000000000000..d96f6d7cd109 --- /dev/null +++ b/drivers/misc/xilinx_tmr_inject.c @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Driver for Xilinx TMR Inject IP. + * + * Copyright (C) 2022 Advanced Micro Devices, Inc. + * + * Description: + * This driver is developed for TMR Inject IP,The Triple Modular Redundancy(TMR) + * Inject provides fault injection. + */ + +#include +#include +#include +#include + +/* TMR Inject Register offsets */ +#define XTMR_INJECT_CR_OFFSET 0x0 +#define XTMR_INJECT_AIR_OFFSET 0x4 +#define XTMR_INJECT_IIR_OFFSET 0xC +#define XTMR_INJECT_EAIR_OFFSET 0x10 +#define XTMR_INJECT_ERR_OFFSET 0x204 + +/* Register Bitmasks/shifts */ +#define XTMR_INJECT_CR_CPUID_SHIFT 8 +#define XTMR_INJECT_CR_IE_SHIFT 10 +#define XTMR_INJECT_IIR_ADDR_MASK GENMASK(31, 16) + +#define XTMR_INJECT_MAGIC_MAX_VAL 255 + +/** + * struct xtmr_inject_dev - Driver data for TMR Inject + * @regs: device physical base address + * @magic: Magic hardware configuration value + */ +struct xtmr_inject_dev { + void __iomem *regs; + u32 magic; +}; + +static DECLARE_FAULT_ATTR(inject_fault); +static char *inject_request; +module_param(inject_request, charp, 0); +MODULE_PARM_DESC(inject_request, "default fault injection attributes"); +static struct dentry *dbgfs_root; + +/* IO accessors */ +static inline void xtmr_inject_write(struct xtmr_inject_dev *xtmr_inject, + u32 addr, u32 value) +{ + iowrite32(value, xtmr_inject->regs + addr); +} + +static inline u32 xtmr_inject_read(struct xtmr_inject_dev *xtmr_inject, + u32 addr) +{ + return ioread32(xtmr_inject->regs + addr); +} + +static int xtmr_inject_set(void *data, u64 val) +{ + if (val != 1) + return -EINVAL; + + xmb_inject_err(); + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(xtmr_inject_fops, NULL, xtmr_inject_set, "%llu\n"); + +static void xtmr_init_debugfs(struct xtmr_inject_dev *xtmr_inject) +{ + struct dentry *dir; + + dbgfs_root = debugfs_create_dir("xtmr_inject", NULL); + dir = fault_create_debugfs_attr("inject_fault", dbgfs_root, + &inject_fault); + debugfs_create_file("inject_fault", 0200, dir, NULL, + &xtmr_inject_fops); +} + +static void xtmr_inject_init(struct xtmr_inject_dev *xtmr_inject) +{ + u32 cr_val; + + if (inject_request) + setup_fault_attr(&inject_fault, inject_request); + /* Allow fault injection */ + cr_val = xtmr_inject->magic | + (1 << XTMR_INJECT_CR_IE_SHIFT) | + (1 << XTMR_INJECT_CR_CPUID_SHIFT); + xtmr_inject_write(xtmr_inject, XTMR_INJECT_CR_OFFSET, + cr_val); + /* Initialize the address inject and instruction inject registers */ + xtmr_inject_write(xtmr_inject, XTMR_INJECT_AIR_OFFSET, + XMB_INJECT_ERR_OFFSET); + xtmr_inject_write(xtmr_inject, XTMR_INJECT_IIR_OFFSET, + XMB_INJECT_ERR_OFFSET & XTMR_INJECT_IIR_ADDR_MASK); +} + +/** + * xtmr_inject_probe - Driver probe function + * @pdev: Pointer to the platform_device structure + * + * This is the driver probe routine. It does all the memory + * allocation for the device. + * + * Return: 0 on success and failure value on error + */ +static int xtmr_inject_probe(struct platform_device *pdev) +{ + struct xtmr_inject_dev *xtmr_inject; + int err; + + xtmr_inject = devm_kzalloc(&pdev->dev, sizeof(*xtmr_inject), + GFP_KERNEL); + if (!xtmr_inject) + return -ENOMEM; + + xtmr_inject->regs = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(xtmr_inject->regs)) + return PTR_ERR(xtmr_inject->regs); + + err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic", + &xtmr_inject->magic); + if (err < 0) { + dev_err(&pdev->dev, "unable to read xlnx,magic property"); + return err; + } + + if (xtmr_inject->magic > XTMR_INJECT_MAGIC_MAX_VAL) { + dev_err(&pdev->dev, "invalid xlnx,magic property value"); + return -EINVAL; + } + + /* Initialize TMR Inject */ + xtmr_inject_init(xtmr_inject); + + xtmr_init_debugfs(xtmr_inject); + + platform_set_drvdata(pdev, xtmr_inject); + + return 0; +} + +static int xtmr_inject_remove(struct platform_device *pdev) +{ + debugfs_remove_recursive(dbgfs_root); + dbgfs_root = NULL; + return 0; +} + +static const struct of_device_id xtmr_inject_of_match[] = { + { + .compatible = "xlnx,tmr-inject-1.0", + }, + { /* end of table */ } +}; +MODULE_DEVICE_TABLE(of, xtmr_inject_of_match); + +static struct platform_driver xtmr_inject_driver = { + .driver = { + .name = "xilinx-tmr_inject", + .of_match_table = xtmr_inject_of_match, + }, + .probe = xtmr_inject_probe, + .remove = xtmr_inject_remove, +}; +module_platform_driver(xtmr_inject_driver); +MODULE_AUTHOR("Advanced Micro Devices, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Inject Driver"); +MODULE_LICENSE("GPL");