From patchwork Fri Oct 28 09:01:03 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: 13023237 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 ABCD4C38A02 for ; Fri, 28 Oct 2022 09:03:00 +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=v5PeX6FVsftGQ2cAanjlTakdrotEbuNmmY19qCNRFh0=; b=4qFCSMQp+Zan0Q 7BoTA35LAJLWAUFVhC8mEvin3XoWyHAB80PQ9pJcXkm+gw9XUKZtayH9WP715gxt8LPjCjzEQn77D ZLjyTK5dDynFFCzuPxkIcaeaY3uVC1qRfjK1aTW0R3L80zqIXq2nwGhLLYveAHBlCooqil4v1TRmn EU/xtXkim4boGZH8QyRNBe54FgzhKPDOuIYwU4cg0+QMg7QdqKjI4s0E7IjJ1mX9uxwQFwKIPkLwX wC+6gGXzUPj7xs9Hw5r4okgS5nWnqvCa/7on4Gz2AlU5e6Dzz+fOwBdjxNqC9R1tzbchsuDiKRJIS yDpGrrO8+jym7nWNSi3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLFR-00GDeB-8Q; Fri, 28 Oct 2022 09:01:53 +0000 Received: from mail-dm6nam04on2062.outbound.protection.outlook.com ([40.107.102.62] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLFH-00GDcB-4M for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2022 09:01:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5Bm1oS9pD28/XhHJrRDKKPfp28x+z8f2KfqKiprIax1JP3Bo7/lf4nkiwGpmV7n6HZailm/uofztQWnwiFgn8s9mkNN7eoBEzdPyd+gkc0lwtl/Q8zSm+D4Ve3HPuP73vmDALkKoAMq2h2WQqwCuZAkLi/ibp6UKhrso8qfXCcP+JGBEiO3s6AlQyZjft5AqrwFIL9GVd0MbxD51hv0PPApdeSQHSleBYnJOqYTCQaM3DfJMzgq/HOPJe26GIBw6dALp0tlF7GKGlwzVqIlct3aDRWTgF2uHLRb9CAb8yr8viB8juGlP5Ctm4YuqA2A4KrMxtCV15laB7cqs2mzuw== 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=/0glP/0nIs/nLD9xItcKJd3m+haoxVBho7FsTDRMjF0=; b=kVo+SZrtCZyl56KcxXZHXauW5EVlHpWtp1dhPLtoT0tOPPhQoM9Xxua6RJU0fKIAGmx6dNoGh6Y4DAkmub9RMTOPWV8T99Ce3UvRAag52qlzlP491EtBMRdv+T/K5EXRDXTvMPhYYF3/AjrJDpFiJrwWZkD4FKr7lb9bXtEMS8+Egj5RiuZ1lKPSqLgzx0R5n0lLWIq5zq/exEsCJFLTniIreE/gt22rbf4hTac5T2hleHb52O46yVVjqgEVQdXI9FVQOG2GMtjEc/dmnxcDGUnnjs0ZUmcxRkQGO8FtZSHU9RD18bQllLT2NF9pvDG73Ii2vmeQ544yJiGDZjEwYA== 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=/0glP/0nIs/nLD9xItcKJd3m+haoxVBho7FsTDRMjF0=; b=qJym5RrYGyblaZyNPne5AocYJN6fYRyz0Ej426mwymvwvSdunHRBf+mX/tJdL/J3zcu6aV3J1WE6dhe8YEB5sKc6sjgc2ZNGmfHA6LgoI2eLl9GXzN9uXmFQgNo1o3cs6PN8SmbF2h9iOzjbURAS+UrzDqgIU8b8CqyQNbxjQ4U= Received: from BN9PR03CA0945.namprd03.prod.outlook.com (2603:10b6:408:108::20) by PH7PR12MB7140.namprd12.prod.outlook.com (2603:10b6:510:200::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Fri, 28 Oct 2022 09:01:39 +0000 Received: from BN8NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:408:108:cafe::c0) by BN9PR03CA0945.outlook.office365.com (2603:10b6:408:108::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Fri, 28 Oct 2022 09:01:38 +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 BN8NAM11FT034.mail.protection.outlook.com (10.13.176.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 09:01:38 +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.31; Fri, 28 Oct 2022 04:01:37 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [RESEND PATCH v5 1/4] dt-bindings: misc: tmr-manager: Add device-tree binding for TMR Manager Date: Fri, 28 Oct 2022 14:31:03 +0530 Message-ID: <20221028090106.1456940-2-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028090106.1456940-1-appana.durga.kedareswara.rao@amd.com> References: <20221028090106.1456940-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: BN8NAM11FT034:EE_|PH7PR12MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: e6c888cb-2621-464c-b2f8-08dab8c3061e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IdPeUakhcgC36SFBctBOMlFwvfF28hkx9guvuJqb8wEHakWF+Y+JSrEe0hKurv594n5l6fKdvtQ5GUQ0n5MjOrKa3cJ2Or4ZdmhqFP8xF8xyVryXoQc/fmMqLClj6CwHSGzVXmmKj7kb5zmqcZqjJKvh4D6V1AFf59w6jLXWyRBKrqR+5J+L8ntTk8TZb0Q+yvr+1fZZJ1L8dub+h8KYEX4xwI+FuNBvI/kHtFZ+BdooLPiMOi0tki3dloAnFpIwIVTplIU5G3b2RppDK+x/yoczSD594xIA29sHJWTckXZE2lNrzYeoogBdYjM34y9CG832WiP0IJyoPX47k/W3I+Jm1MDDs5FcMnEnIsN+z4vrDwLbzN3z8nPny8K0jCp6Bht9d+ET5d8a2wIyDI8czxC6tc7+XXHlJnv1gFNGwn3bXoaxAXd973eE27+Z68/h2Nbpeti4A7CeV4OIFx4Ax7aStQudBiNsO7uc+GT0ZnSSekMTcurQDOut9GOwCFpAmX765PifgKHbDmuv3yoB2dg64k0lLALcolj0cOQk+9vModM/gVTAExPlGJNKBlGI78r32c8I8LxYanthqfhFtMqKuSC+mGrMMJnqQuWqrEAbbGkclFvStgCVOGvKEpJf5h6HZ+bWKL6VNfYzld333o03NpzS2oQJsK5fEfIx9XLrvKbtzrwbrxJGV4Ese0rFDzJnoZOPUrwLnUekN7fy+DLSLte0nAkIWzFz7MjwUW5lJwI6HcSujpEnfzMRNMRFOJPLxw1JgIJqHqlFLABOa8gv8mDMAQ1wP4le4Eq5RjxfbjidFlfrxThsIKZqb25FIjE6C3/Y4xMSSatMvKKRXC52EReI5vPehEvY/97iegDUOvSDpHx8y0LIW9iqxp5qUPgmFTGJSgglZGgdIaG+jg== 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)(136003)(39860400002)(346002)(396003)(451199015)(40470700004)(46966006)(36840700001)(26005)(36860700001)(478600001)(6666004)(83380400001)(16526019)(186003)(2616005)(426003)(47076005)(2906002)(336012)(1076003)(40480700001)(40460700003)(82310400005)(316002)(54906003)(70586007)(110136005)(966005)(70206006)(8936002)(5660300002)(8676002)(4326008)(41300700001)(86362001)(36756003)(103116003)(921005)(82740400003)(81166007)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 09:01:38.6686 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6c888cb-2621-464c-b2f8-08dab8c3061e 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: BN8NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_020143_194317_63915822 X-CRM114-Status: GOOD ( 14.90 ) 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 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 Oct 28 09:01:04 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: 13023239 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 B8705ECAAA1 for ; Fri, 28 Oct 2022 09:03: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=NF2q1sNjIhizQH0sTNibX8/5Yn4q9khGDMXpkXlFM+k=; b=z60AWUeIZzyumK 7LVM7ahrhxULa6wBPAuZX9UG90KnTq4dTMlWVxpUGjwZOlwmAdraW8HZrP3b1g8AaoHy7ZQFQ6wU2 MC0KBQVo939QCVo/h3hEvD4fJDNwiOdQVg9kQwDkPVZ2ol3mcklCCDubbEeoU5y1Ma+ZVGq7S8Ifg tnz4RwuIau1IIm2BDF3qiKnqepGZr3vTWVBH25Aci3WQAXIm78bw0EYu+lrEKJpF9OPEuQ89XIUSS VZ5EyW8g2X3ryYjnSlIxSW7BrcvWXKlsuZjT7AiY5vchLw0TTGQiunsZiCl95q7YenG4Hl60vULdQ 0Awii12Dsilfh5DqHLzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLG3-00GDl1-2K; Fri, 28 Oct 2022 09:02:31 +0000 Received: from mail-bn8nam11on2040.outbound.protection.outlook.com ([40.107.236.40] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLFs-00GDgp-06 for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2022 09:02:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n+ORHootCtZ+nNm785MfuBFPcNlkWYkA9XSAIFtWk0OwotJl5czXrkLhWT9Ys4FohACFD4lBBw7Hu/uSosZpf0SZvbeROMiZcblLk8hFX1dyAQytXHL5CxgNbFCB2u/PzBil7nw4Q5So6FzXqSIf3uf1FWX3zuemWy/09jHqY0MVq0juAH+mINZzt4uqYyI6GaTL0aJVqiHGkPl2RHBwILhpQNwj7nzz4Jh2qaSvIJFKTXpQYPG9OfvjuuJZB76tOeuHov8YHzy9OhmoZ2xFBRuJy3Vd19Fg2/Vrhqjnp6malsCMJHSArTMClgXo5IYpBEkz9pluD6F7Via7gFqhPA== 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=QSR8k6Tf+i+1ayLTrEPZnRBnzL7Uk+066XkvgXAfrms=; b=LytUP14IsAmZm3b0xYykrHVekfrYBABM9TuQ3JtlfWif2VFplLtkrm+p4ha07w+5oQFmt/G4hjvK86zhMXM8kS/H1coib28Ie06R4Y1GyXhHfaSrScpp8t8zWRWXIX1y+wpljbImpxuX5gVfsB5niOjX+4Fz8MDgVS6+/NkCKHBr1bE9W2AepSlboZGDaLChPqla0rkBtSyIIIeScHuTCa6uC7l+3WUMcUwEH3Zr0s2rklvbAX3AMTKe8SPrQNl6nV02A9w1x5YM6wov5zml6OvDzItFHIkyf2it2jzgPdvE1WoYG3867kSqGPaPdQ6Xxztkkr5wafpB7jKFk5J48A== 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=QSR8k6Tf+i+1ayLTrEPZnRBnzL7Uk+066XkvgXAfrms=; b=W94C0XivTuXx8ajd8snzW1T4lWqBFmCpXIK4zESYUT8JWPSc1/sKtOUZUV1lfE1OEWoIwTDgmcOHS7XF+6W2sZjUNvlST9FdCyljPCiB06hwUpSfqOeXutMU9IVblpg9U4ECq3ngYMKguxMKswEk7dWW365rxk7K8SwOfLue/JQ= Received: from BN1PR14CA0023.namprd14.prod.outlook.com (2603:10b6:408:e3::28) by BY5PR12MB4308.namprd12.prod.outlook.com (2603:10b6:a03:20a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Fri, 28 Oct 2022 09:02:09 +0000 Received: from BN8NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e3:cafe::8d) by BN1PR14CA0023.outlook.office365.com (2603:10b6:408:e3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Fri, 28 Oct 2022 09:02:08 +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 BN8NAM11FT079.mail.protection.outlook.com (10.13.177.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Fri, 28 Oct 2022 09:02:08 +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.31; Fri, 28 Oct 2022 04:01:40 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , kernel test robot Subject: [RESEND PATCH v5 2/4] drivers: misc: Add Support for TMR Manager Date: Fri, 28 Oct 2022 14:31:04 +0530 Message-ID: <20221028090106.1456940-3-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028090106.1456940-1-appana.durga.kedareswara.rao@amd.com> References: <20221028090106.1456940-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: BN8NAM11FT079:EE_|BY5PR12MB4308:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fd9430b-b80f-41cd-e825-08dab8c31815 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xFk4IxWr7hDGHluNJtxKcC1TZWDXUG9SbIDbxvejZ7Xg3ctPvwK9KQzjn1uGuYxUPFQEsptlmHJ/pTObuGBYRu3XLIh2/n2jwaOfjhzZh8dwAbbWTYSBy0xQp5YSsWCKfDeVduBtodKQbQ+mz4lEz3jTm63aaH2dwZOFPHuiMTEZFyAQyvNdlVllAa0xrDG2hQUiYYUOfgxPR7iR+CZoyNUR2IZW9g4g/CxWTTXlaf5ZxRa7q6CeEwoFp3DPbvVxg2woQ+YpBy1bDNn46Rlxxkefi8PbtnwUn3A9oWjgFbBr/ZrrtUkJcsqdBQ9mopk4uri+fb7SFkOKxMsrrhtF1FCfPkmtVuXIj1iaJ6Ijy+fj4u+h4uvPnitlwl7prILvJM89pEOcGEKV1Wskft187OxxS1+hJCdsZJFoVBoWZJls1bQfO3HD8VgtDQ9B4aVtb02/p7zSlzD2ssDWCh7f+1jBU/yTY1LSOtxqz1z64+rhg6dH7KhQeLGMKykLORdmEOv1y7C7NYccc/F0eHARqRBZISRliY+VIik6Hp+Y3g9HeBxv+TPr0/fCLaaPcYwzq19xcKDPKAVlxIVHtzLIgesQTZcfV/S2PzQYsjGa5SGh8iYPLDiDg3+nSC2Pd/0QF5K0vs6rdgXonfYFiIgxm4//SGWqZ8ZP6ZrXgKGA6uzYc+k5OTNbm3tJDhOLKmhg64PJ06X38IkykitM+vAvyW/TVipckQP34ZnPyUF6l/d74bOLCFictU11ET4/1z60+/BRns/OPZM93CQao5fcQQaHz59mj/bOc8WkIUgAVFO0/WAx+FohpemPZy337Dwe7RRXHBCqKunnFbVByNcsw9d9/z99FM6dakR1WNzccfM= 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)(136003)(346002)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(103116003)(36756003)(40480700001)(86362001)(4326008)(82740400003)(81166007)(110136005)(316002)(54906003)(40460700003)(70206006)(70586007)(356005)(36860700001)(921005)(478600001)(83380400001)(426003)(26005)(336012)(966005)(6666004)(82310400005)(5660300002)(8676002)(41300700001)(2616005)(8936002)(30864003)(2906002)(1076003)(47076005)(186003)(16526019)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 09:02:08.8100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fd9430b-b80f-41cd-e825-08dab8c31815 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: BN8NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4308 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_020220_135443_5F24CA6F X-CRM114-Status: GOOD ( 24.73 ) 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 Reported-by: kernel test robot --- Changes for v5: --> Fixed Unexpected indentation htmldoc warning in sysfs-driver-xilinx-tmr-manager. --> 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..25c62c1c084f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager @@ -0,0 +1,16 @@ +What: /sys/devices/platform/amba_pl//errcnt +Date: Oct 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: Oct 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 10c1344b4473..2cd9e7594759 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13416,6 +13416,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..535f723c1a5a --- /dev/null +++ b/drivers/misc/xilinx_tmr_manager.c @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx TMR Subsystem. + * + * Copyright (C) 2022 Xilinx, 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("Xilinx, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Manager Driver"); +MODULE_LICENSE("GPL"); From patchwork Fri Oct 28 09:01:05 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: 13023238 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 88544C38A02 for ; Fri, 28 Oct 2022 09:03:24 +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=X4nEIpvuXQa2APFQK8xtzceznn6OeI4mVSENt51cgg8=; b=XfxrZLs+cwPMRT dERH6bd0zWJlZUPMLFFnQcAXdCBD4RMt0X9eTxMZzFAe42XyQpDogIVZHS0A2Q0VJVQ8NLxlrVpoo lwkwLlEH77Rm7wRV7KMP+HZWEpuUVz6LHwgK1IgO1bm2DEexqmGW+3NGp9WOxpNFRfzcL+CE09NGK sOJG/fj0J0zu/dXHbyhuPI+Ig0EBbhEXTsgCtuyLLHnCLaVsSpTf8O6fzVaEqORSUwOmiEEds4kUg YV9LyMrtMYfO6phPpFLiwgIDP72EN1YQrRtBFpVwazdmyqJDaesZixoP/DM4L9bLV96qFaLZe6HVO Elv7cYqsFfJbcO6A5KlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLFs-00GDhv-RR; Fri, 28 Oct 2022 09:02:21 +0000 Received: from mail-mw2nam10on2067.outbound.protection.outlook.com ([40.107.94.67] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLFp-00GDgo-NL for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2022 09:02:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ctl3GxuA18GripVvFjsm58FLzkumfi2SGPV69bJh5ru7AgVDHHJTfeMcFSdpCl0FkZ2+LdTzqo4eZjR/nVEPNE/oCBRoGo81Op9Bee2MM3Raj4XSOFgRf3LLIPm34SXNYFd8JvX09OuZsvqO+Na8Z3ODRpgMFzi2kb5rx3Up3wJnVPwe6v3LHgvvEO06Bq0WskLIpRUay/k2qS/3vdeYDXaon1m93dkPproax0QIJBeJC22hdI3CfJtLGCCcf4PkzWNiq+fVG00MmuPlx96cqWF1CW4WjCjW2EmCEtbYHlceic9S33xLrI4SFkc4bUASIj8CUXtCDoIhzSWf2NC5xA== 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=e5t6qjFmP045OWPl3Ah/l2TYsr2RqiQzpewzkLa/tr0=; b=Sj9a1hbllv65qkY4Zse+DB9PZ9nqma2LBhtCS2De5c9+F7i5Hz2aoZe1g0e5pG1Yk/E6ZrkPG7qG5qhRlEjT6GrMFwqsnc+sP76nqlFttFg5+ulUxXdJSXi9zm7ZQaCFYopiSFvSjhDQVxJbP4cHfoQEgVK3SIDqK+grfqLDE3K50pKZmik/jr3a7WGPh/Lz1nTbCOD5Bm0E1dYAk7naWtsgH066C45jhwxcO43GW8c3mZ5s5Xv/esu8eH7ckUGKH9ejPpWvNi+6CgPPY3O26PLWsA5eDHHlUZvhO3hABVM7o7kWdpL4dBJFWHJEtt7XcZkDKPA7/9DVBwd7ZjKVQQ== 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=e5t6qjFmP045OWPl3Ah/l2TYsr2RqiQzpewzkLa/tr0=; b=TCrHrKM6gvP7Pbu0XDNxml7who0D8lVzWT5F6i4z1yvE8PyC+/6K/0XS64hYwxOZXiSMdZLUCtKOo58QgSxRgtx+zSsSEpddLPw+JJTHs1NtWrc8SirU1NR08bAnWHUoCGapJj7UOkyBTMHniq0QH2h7lSWUhZqASc6X0rYwi8U= Received: from BN9PR03CA0347.namprd03.prod.outlook.com (2603:10b6:408:f6::22) by MN0PR12MB5785.namprd12.prod.outlook.com (2603:10b6:208:374::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Fri, 28 Oct 2022 09:02:13 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f6:cafe::67) by BN9PR03CA0347.outlook.office365.com (2603:10b6:408:f6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15 via Frontend Transport; Fri, 28 Oct 2022 09:02:13 +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 BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 09:02:12 +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.31; Fri, 28 Oct 2022 04:02:07 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [RESEND PATCH v5 3/4] dt-bindings: misc: tmr-inject: Add device-tree binding for TMR Inject Date: Fri, 28 Oct 2022 14:31:05 +0530 Message-ID: <20221028090106.1456940-4-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028090106.1456940-1-appana.durga.kedareswara.rao@amd.com> References: <20221028090106.1456940-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: BN8NAM11FT023:EE_|MN0PR12MB5785:EE_ X-MS-Office365-Filtering-Correlation-Id: 27ac1ba9-8f19-4c54-b660-08dab8c31a8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NasPAvj0W6u3xaf+sz5IM1PR7ZX9VT55LF45OMwSSlxSKQfA9jTk0V6PxNIB/XUk8l2rMPiQp0ARCX2/YWLlI+3LzXpVdHOYV4rR2ZvBxSTVgoD+HlsfGekLS8o9bfEUHJvyHR76NKOMfj+U8V4ke1evVJACNze2OvCHtvA4omSC8AQw4eIgvm+7dg46RfOHOBL66v/82DV7kzuDpBRauzWBd3DENorAGQLhM4/eekAGy2e7nYhapsuYK0ZndnOdEfV979GHclbw9iTptKg6Qe7uA3ecuHdh3YmfNvSqqTrputk5RQYsJJY8EWuWIsNW83tTJmWtXeiE0wwTK6OYDXUfpf+STqaIJftxd9m76DsUzyBG4Z6vR/AqyXV8jW02hxs9INHvPHl/dueB1vWwUbcR9YbHKzksqn+cdHlVcZlyZ/JrLIL/peq33y96frIvroTAlqFIco6SOsKkolZzK7m7+QJpZIWcD7oQ3iN3JsLqA13vqJCs9pbSMy19+9YTsI1YfNO/zgrkn1yMQiz9YK20rI831zfG6QqZpYzLFe6owklyfQOJqepOb7h+5aJtXVr6aOJn1TWJrnn8vF0eD5EmplQfww5SI78PyaKO3ZGKgKoUYV/C/YWAYKP5PtDQqrDqHNmc/qgdo0FHhj6c7y8IubEW2EEt757nZnJLpXI85zda+Uy1ibwIGfZR1wE3emgSnrISUTAiqg2MKsJZ2VJGZGKyem08ZMSdVsfWJA50LA4ccuB2i0ENmgvS1lTwDG4FkB7vsm39alIE2KZhGsA1RLomM5iDm0Q76m1WVcnsrJIZpXWyfnsOj1h7CmPTWyoFD8QAsWH5qNDEDO0RynWEiQIMB9CdQHsxSnqQG5KZLkanBwsUNLnmNoRfHEud2Q8XHN/RDYTSZ7qIKrbdTw== 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)(136003)(396003)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(921005)(70206006)(2616005)(1076003)(47076005)(426003)(36756003)(4326008)(81166007)(8676002)(16526019)(186003)(356005)(41300700001)(86362001)(2906002)(70586007)(82310400005)(336012)(54906003)(966005)(40460700003)(478600001)(82740400003)(40480700001)(36860700001)(110136005)(103116003)(26005)(316002)(83380400001)(5660300002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 09:02:12.9309 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27ac1ba9-8f19-4c54-b660-08dab8c31a8a 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: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5785 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_020217_780390_33788041 X-CRM114-Status: GOOD ( 13.76 ) 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 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 Oct 28 09:01:06 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: 13023240 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 C6A43C38A02 for ; Fri, 28 Oct 2022 09:03:52 +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=8RhWgJABuiOEdkcYU/OE0kSht4oY5kztfp4d1RdXAMo=; b=p6pnqMNWCYpuf/ 1ldwxHjzg/GIx8LFLytTdDCqw/a/RgOkLLToxVtM4P1NwsoDjvrTNjCsdhdTbpIS6tXFZLYXEnaiR hdlO4W5mT0k7v5bIvjYaKv3/z4A0JKy2HQg8IOZgbZJYmbiwQ0hVly235BFRk+lxvk4OVRd5hp/yn LZ865iKuQX4YmYTn4eYl7bJV9NvCOIFYQj+hV4DqFr2eSNAxyVsrSrfnJAv2MdoHIS/vCH1mKj1b5 jrKPplaNIie6/OmTRczgfHQEKiu9Ed4xR6dI85fIxzaOsaCjAaOiu1y3V3DhUrdJa7YMETkfnR0lr 5+bJJRQkm1b5E2Kg1Bww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLGI-00GDpv-2p; Fri, 28 Oct 2022 09:02:46 +0000 Received: from mail-dm6nam12on2059.outbound.protection.outlook.com ([40.107.243.59] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooLGB-00GDmE-5v for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2022 09:02:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2XiwStuLa1ONJ6ppVOb+tN8RkjGQz/vdl6yaqNhZrspIYaGS0/5/xzU1ca09hGgNV3tRvPtRU5aFx7ATOVSyex/vP5n7w5/RfLylF2B3FtTSs78fGN6d+0SyixKj+L46y0Uh5d1H3ON1LAIS+xofYwGAJrno+mrDAsfsgmoD7saaddeE9XwhGBXte+NNsJC3aFVv4tvCzfGLuDsziI6eYMl4YKmMMDcM9lHiXWBvEF433g4lK50o+478VLPE3A14jDiEbUB4nvFLF/tNEjDbKLnhFuSPMXADZyZdFzKC0GVU+SpZmzymgn5fclpR5574VbcCUKRlD4cxTnCYsCgGg== 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=b98PR0HB0DnbMVoz3Amp+vimcz4HfQYCCwfAh89HIRU=; b=Kq7A7nEQDExBjYI95HpGg5JLZo0Rz+wK8iwS8in7rziN05TdsywSBeGbTOZsgKm1tlecT0zoW+vgWV+SkpwPwj8n6RZLZCjKWHOJzID5qgAuB1paex89KWtZwB5E3ZCIKO/VJSLprnSqpQP436+7YXgULJ21sfvI7L18NSW4xcw5id9TJWmwOxApfdO57TkifkFEFtvxJ+QE69RTwwfxLCSBqWR8oCA4cXJMZked/VW5elxO/lfCZABGsurDzji+cbB9F12vcL6Fhgc7ikUcag1iYftTI8C6YDPiTQb+qd8fIG2pQD70l2xqkI49pVN13qLUwbpefE9SO6TIZTtNkA== 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=b98PR0HB0DnbMVoz3Amp+vimcz4HfQYCCwfAh89HIRU=; b=ZF1cT50oeRw2zn6vM9HGFf2iLZQVyHsTXhFuR3Anb82ABhps+aWsr3letYDHoBUI1AzhzqIY5xVnlrofNcxkp34Cy6Q8yuiTpCzduzCxnlyT6wkGU6uEO8JP7+zz6S+WADJdkVypGagNrXRZLpsDToV6PnvdGh5faAC47f4WX3U= Received: from BN9PR03CA0893.namprd03.prod.outlook.com (2603:10b6:408:13c::28) by SA1PR12MB6896.namprd12.prod.outlook.com (2603:10b6:806:24f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Fri, 28 Oct 2022 09:02:31 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13c:cafe::aa) by BN9PR03CA0893.outlook.office365.com (2603:10b6:408:13c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.29 via Frontend Transport; Fri, 28 Oct 2022 09:02:31 +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 BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 09:02:31 +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.31; Fri, 28 Oct 2022 04:02:11 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , Subject: [RESEND PATCH v5 4/4] drivers: misc: Add Support for TMR Inject IP Date: Fri, 28 Oct 2022 14:31:06 +0530 Message-ID: <20221028090106.1456940-5-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028090106.1456940-1-appana.durga.kedareswara.rao@amd.com> References: <20221028090106.1456940-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: BN8NAM11FT021:EE_|SA1PR12MB6896:EE_ X-MS-Office365-Filtering-Correlation-Id: c02f7b6d-02f2-472e-2ea2-08dab8c32582 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0xgjouQusocceKYy+ojwGWMSk9pdIla5ODjbUveRV5Tc/63xOEmG84BKd6DisE7v9Sape/+yr5/EChQLR7zbuN/guTQ40R2iG/YjI76cls20QBL8KAzfvxLrj+saSGME33U8KtMEs3Wz9ozInhbllnTXOqmRdQozWIueozk6PW9S8PjPF4mjZLtL1kpnucbXHGknDtk53/g2VrnXNg2NUrvZgWQLzqZxHAfna3C1VAOxiNk8DN1qq1H/XHRCQcr5l0PNj7XPYkg2an2aAvPk678JSxd2PNJC1ajsKNXdE14m59TE+HBD+j3a50CrdlCsG0dDWoN9cRhDJDdbu3kp9KHGqQUs7ahJIkF37guH4KzP28U3QXNi0SEYKAJIIywnWKIyR9ZBR0M8/HcJMgMs5xscPLmHves5Yti3F6fA00PZMeoqivjArR2ggjSZlqyw4u+kzlR0+kJl5WquipIMlmH/+U9Mj+HeumlyoxYv5dxN7Pas3fFmPChOi+pfv0rSTqG8mjJYdATJD14yktzCd/7ploouYdacZF0XIOCfq/rOPkvRmPbrfeV6DiGMFN9YGsBu9Zk8wDAQjbj9TEeM+xzB6ndd1T/QZZKA49kJiZ+CZ4bZQKoW/uaZ6hoK+hxw8kB/XmG9IbMJsgwPARGQv1RhU/WpSHiVKrr4skA4uxI8+yXCKRhKmXgNkzmEwYNy9sp8A9JypDt99vflMhkTXocRV0QMxMMTTvS9oCg7Q9amv/fjODJWXjYHvh+exmGDy3gzZVjlj9qsTCdrlsti9Q4ASjADcd7HghGhc+zlneqg29AnCxJMaSWff2P7wwUD 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)(136003)(376002)(396003)(451199015)(46966006)(40470700004)(36840700001)(921005)(2906002)(70586007)(316002)(8936002)(110136005)(5660300002)(8676002)(54906003)(40460700003)(36860700001)(478600001)(103116003)(36756003)(41300700001)(426003)(4326008)(40480700001)(336012)(16526019)(47076005)(83380400001)(82310400005)(86362001)(186003)(2616005)(1076003)(81166007)(356005)(82740400003)(26005)(70206006)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 09:02:31.3299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c02f7b6d-02f2-472e-2ea2-08dab8c32582 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: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6896 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_020239_266644_2532ACE9 X-CRM114-Status: GOOD ( 29.71 ) 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 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 2cd9e7594759..d8ecd9feb188 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13423,6 +13423,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..d4db15b8899d --- /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 Xilinx, 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"); + +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("Xilinx, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Inject Driver"); +MODULE_LICENSE("GPL");