From patchwork Fri Sep 9 06:19: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: 12971046 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 69061ECAAD3 for ; Fri, 9 Sep 2022 06:20:45 +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=52s7zzAAMqesywa+Vcx9YAufgG/rVTEJlFmFw0A8ToA=; b=uY3wC7BhtJDXen eniHdpuSVdP0xRcLJtlMV8H1bx2es9Y/rGWhjF+I3Q0QNcbVPS5yV+IiiIYCr0FMercTzaI9q/2kS zSvtHpIX6oXKge7Sr6bgCtwPk6UgZK430FXr0tO3syOlvxqBA13qVNR2HZuMxHXtHY8l/JkZsRR8C XQ1WXTlTGRKAK7cOEleeJntjyNekhimbf4yxmXKNkGAbbUHXlGA+cNzaE98XZwLVyDaUhWi8rYKIK eAUZOIvCqWSmz81z20TVlbiH8+YSPy2cOUv6MU+/hiVJjG0xBx5QEfi03dXhlkxoBgeNUl2f8tCqb t8v++KZWrMFQDF9ntm4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMU-00DE1F-QE; Fri, 09 Sep 2022 06:19:35 +0000 Received: from mail-bn7nam10on2070.outbound.protection.outlook.com ([40.107.92.70] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMR-00DDyC-Jq for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 06:19:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9Bixp/eKjIxu4AuH1mWE1NeSh94HjcMPAi3Vl+WDwlq4n1lrT1d88z3qmViPx/SEv6PgCPWvrphSyf8fG+saWdhz4mAKtw7rlQF8eZAvqUAsEhxEW7PFxCho1RWVDKs2vqsXX9jrdaQXrNzH6TKh643q8ZcgUzIEm0R+pWrDv+HvsEUGFQ8ER0CV1pUI01k1fvUVSggqgj/PSwX+b+ipL0MVviWjW7uwnllsZ0WyWqbShPp3fpZIG8RpNWOmfkhrPsCeqagTWNFLunRR59fqARqmrJyrw3gy9qZR+yI++wFEjLEkVMFSdrpgSz92nDYEfflOuc/g7itRYVLjMFCow== 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=137uaIFR9zNEFyrHAr/Rg+sW+9kQQRZVKddw1eDN7aQ=; b=OWumzO4ksv9fPLsguhzHfxl0ML16rU/6NmxECjlmUW0Ebt//jQXjguQ3Jg2Smer5d4YbfJzYgWprrxCw/BYINRyJUU5ZyxH7Lq9R/2wUK/a+ItEeAyRwCPfdrkQ+hHM2VJm7wj3/76ieWDYEIA1WCi4fdcuP9Hu9P/TTAv3yHEmbDPOQas+v7r4L8PAm4pkWSHoAr8gDzZeAvO2l/2gFXtO9i7BklFzaVeystqFa4oBinPseFFOUMq2ffarrot3qKqZW2yoh0Xb3rxFPL3khpvqcBzbZJGqVqM2bfcprVFIZzQT+Soy2axJ0ggxuuo+BljUAEUSldBS9v3f+finTDA== 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=137uaIFR9zNEFyrHAr/Rg+sW+9kQQRZVKddw1eDN7aQ=; b=zwdB9RZGVeXU8t4PJxra7YE4fZe6v5+PnaUFEztIaKsi25fNpGCiO1WAr24mLjOFamKPJn6GHbKJkZzJG83bNvdbGGnEdTh222oiudpd5pYkdpfkz5p4gPc6CFJLWw9WLkqTiJODsK8Ngn7svwHcMKw6P3v5Sc3tm/7R75PenP4= Received: from DM5PR06CA0089.namprd06.prod.outlook.com (2603:10b6:3:4::27) by MN2PR12MB4455.namprd12.prod.outlook.com (2603:10b6:208:265::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.20; Fri, 9 Sep 2022 06:19:25 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:3:4:cafe::fc) by DM5PR06CA0089.outlook.office365.com (2603:10b6:3:4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Fri, 9 Sep 2022 06:19:25 +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 DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Fri, 9 Sep 2022 06:19:24 +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.28; Fri, 9 Sep 2022 01:19:23 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v4 1/4] dt-bindings: misc: tmr-manager: Add device-tree binding for TMR Manager Date: Fri, 9 Sep 2022 11:49:13 +0530 Message-ID: <20220909061916.2935431-2-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909061916.2935431-1-appana.durga.kedareswara.rao@amd.com> References: <20220909061916.2935431-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: DM6NAM11FT003:EE_|MN2PR12MB4455:EE_ X-MS-Office365-Filtering-Correlation-Id: b890b5d6-b4c5-496b-58ff-08da922b3e24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nqVhVEpBZEq2TiPpHN9J4GEk4Hqm1uO++c7Z/qaegxp8KFcqRsCCeY8sWeHlhtJAQklpjiA0oGbD7rIwmyY+F5rT19Cqz0YIQ88d14Sq/25f2NO459tnmfqCe9nIO5ctqa6HeYtZyuvUDhJq+Mpk4LlZAiH4UZE+QZRQVBs6SE1tIAAy+AmTZ+Sk0VjMBLtWv2OXcb1VW4DTN4PwoQT5ic3AFT7uhfTEM2viN/jWhKVsMCxuSMqCAO8Q8eg58larSbwATUnV5uYXcp7jhiS/RWmRss2weYdyo1jNrJ4NSmCL31e8dFg/k85Yqt84FSBXtxoeilH9hchJlESBMqh02lj2kZNbrZffiGrwQZGO4sm6whaOrPywLosP08kJeKMLEtLlwD2j67Tgjro1EsELCsnLB1tD7Eu8OVnH15DdsVbyzxcXEDkrH/2O7eA4HmgfooTRDqhpm99t00jdAoFLiE5tApaCyKVAvispwO5UBzSS77YYia6vF9X5Mu/GOCK5r/6dkecpDMWwinHcp1aaWDq9v/M9mhBq6TjEqak5vVpG1Qq3vkoFK4fcKnYQCHIq7kPt3cg4tP9UnufhbQOPruhm0LTiQP99PhihDa+xreiOwNWwxlqL5fkrCnQrzebS5aqbyz5UiORMmSg/XrPYvNMWrV8ETgRfb0nQAhhAgU7d7Xsfoc7Vsp2Gq9HBnMi3W6B16qH2CtEZ9Fne7ZfEJnQz/hYfT2B1jHQgWhLEAQup4i5eYJiH/lSSlYOJGaiCyqEdk0BgF7XMZGfDSIu7Y8Bmzh5rCz/0LALJMkaC8u/l7aEW1BBALZgzkZ11ZLHB/gbuAaj2Seb3afsEtPIxpAywpxdTynVRlyOgteYwtBBVxlzM+rpVYS6pKmFV7/y2n8Y9SYwndWxbSl4hBjJO7A== 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:(13230016)(4636009)(396003)(346002)(39860400002)(136003)(376002)(36840700001)(40470700004)(46966006)(8936002)(2906002)(5660300002)(82310400005)(40480700001)(103116003)(40460700003)(86362001)(81166007)(921005)(356005)(36756003)(36860700001)(26005)(6666004)(478600001)(41300700001)(966005)(47076005)(2616005)(83380400001)(426003)(336012)(16526019)(186003)(1076003)(82740400003)(316002)(54906003)(70586007)(110136005)(8676002)(4326008)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 06:19:24.9071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b890b5d6-b4c5-496b-58ff-08da922b3e24 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: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4455 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_231931_697344_0628CB21 X-CRM114-Status: GOOD ( 15.28 ) 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 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 Sep 9 06:19:14 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: 12971048 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 94F22ECAAD3 for ; Fri, 9 Sep 2022 06:21:16 +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=ZYONJgEIxR3R9EfRGLczHsLDbdNCP3D4Q0v8SPk31GI=; b=0jSJx0bnVS6dMQ uvmAjjK5QVfc0MfOwAno7myXEk3PWSgCkW4gDsfsqsNdGfKplRY8TlLoj1uzkxLVMCIcQhbFHHkRI 0a/kLpuxgmgUJ36SuWXbxODQZeWECm8FnjmXl8Wy59gfNoHfUbmBBDLPrSXJeYTOhNr8mpDzIn0YQ iMW1fevkFy3xkTQqkw7yfZHErIHFRtcryqfBfNOwxPVMuzMMi7CcJXmDBP5l7jtCELqoXTTGinmyI Hn6/9aOFFma/VA3rc3EwDbwjY0prce53yXF/zKiXZus3KCDfPvKe0D+zbKHUW+3bDzz1ZK0OdY9sq dk5uTrwW8wWJ+lsC1SbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMw-00DEHM-Qq; Fri, 09 Sep 2022 06:20:03 +0000 Received: from mail-mw2nam12on2079.outbound.protection.outlook.com ([40.107.244.79] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMU-00DE0c-SA for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 06:19:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W3mREHGmxgr04prW1oOPjWCb0M1xmIAJ6RTX/NXqBjpf5wVBd4T3RowHmx/f/jfveNybF2MRxY8i6LMTrjVrMgjPjst1eqNnlXe9jLp3qvUoqrgK1JteNp9IxB7AwtaZ3D53huUrX7Bgbim7sMLSwzAnwrqp46YY1c6a1heOWHQ1gLz+FYg8736ppxeEaYcTuefTzuXjrQdbFLqN1bJblnRbC+PXs4n7pyKTzKAJ/fUdxtAUwa05iowz0y8ZMhyXQ6+hn6dKEuR32cMHt/f1KebiDSZwC+TKpTqox67B/hhWGYi67cFDq2UIeBTjsOQUOwYik2he1xvkZFxSsBg0QA== 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=OiAj4jx/M6co4ebqyN6T6/WjUVYyIbhfOEJ5Q/1XljE=; b=Kd07GM59NkUh5JfGT3eW3qJ0+Hw6oYBEfyTJLgyt6yhYQUnu/0GZXUMjcf6ytI4OJFSVNZqf9ZVlzN79E5Tbt2+Lwg/25jKeCJd3y+MGWXGCkicQd6I40KMZmYQ73zYvVMUk+T6iftP4dC24d/V/rGfk8BrtMiFw0MtyApA3beDIJN2FO+X7VE3hFvEhGQcNWWmEBbu6Rgt9yh6PVOMfRR/dl4PzOg52RLDuSTvyOXrESHt238D1HyLmmifRG9P79tJJQFrBlgzjqGs47sRmTQMbnOX2Gz1JoeFAvDQqSSYHAVQvXojqppYNCfSa8ZBkjVREZLPbwambyr15Uv8c3g== 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=OiAj4jx/M6co4ebqyN6T6/WjUVYyIbhfOEJ5Q/1XljE=; b=3W3TAHlaJfeTWU0GJaPV6X3IWW4bxRZCdmELT/+Sg7zMER2T001INe3CIzGrxxl2yEnW9xPOwlV4dKi4txOXv6BZDNzWiRNa/BnkxOKwCmaZ1qGXOb3ZchOHc6UWVk5Wwm/JNUlvWrBEDIiK5LqfuuPs36Fta6i9ZP+jqAIUDFk= Received: from DS7PR05CA0031.namprd05.prod.outlook.com (2603:10b6:8:2f::6) by DM6PR12MB4313.namprd12.prod.outlook.com (2603:10b6:5:21e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.20; Fri, 9 Sep 2022 06:19:29 +0000 Received: from DM6NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2f:cafe::c4) by DS7PR05CA0031.outlook.office365.com (2603:10b6:8:2f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.6 via Frontend Transport; Fri, 9 Sep 2022 06:19:29 +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 DM6NAM11FT025.mail.protection.outlook.com (10.13.172.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Fri, 9 Sep 2022 06:19:28 +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.28; Fri, 9 Sep 2022 01:19:27 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v4 2/4] drivers: misc: Add Support for TMR Manager Date: Fri, 9 Sep 2022 11:49:14 +0530 Message-ID: <20220909061916.2935431-3-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909061916.2935431-1-appana.durga.kedareswara.rao@amd.com> References: <20220909061916.2935431-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: DM6NAM11FT025:EE_|DM6PR12MB4313:EE_ X-MS-Office365-Filtering-Correlation-Id: 471575fc-24d2-4078-fae3-08da922b4085 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D8EaWe9jifMK37dO2oN+IHAusfkUl3Vm8AwiLNy5BLQ/69jc2pQK7Vpe26M8mdUFl3uOYcByjWRkZyrqh1YB52N/d3uJ+bADNpWIMUnieoS7zBG5Z/i+Jm7FR6qsX7vkVtnpzFhlz/rsqiFvabszkTYOn4Db3Q2Z21nMTTfhaDbPbGbg9V7r9nbiqJ0eNjn3t1bq1CDcjDaoQm1Cn1gGjii9tbQri/VIC03Vxe9j3yOiDSDFKuD7jhLcJQxUUPAcwZx6Jin4ry1v8qQ1OdgBa4D62o6Y2qDmQnQNEpvUt5HUQa/OeSkSle5CSvujfu5OwhQJR6Qt28h1or9MOc0qbLiWAzjF3e1Z1lOQz6Hczeat7ZKpxGSnJHhVaAW56C956HfCXzgtjjslshPfXBhjE08167mkEt4BXndXiUgSHAxNJtH01L4+6dmdpBgEZ6H68jDPo+FknykQ7BHjKYu8bFb2Ha81X95XZ91Laldq5ZNf3vg+rp+fib2UmDdOKST1Ng9pkVr8XqGleGtIu0ylDUDeHF1bKRmE2RR3rQctupkmZBOMttRi/jw5hogLDXUCXHuc/nxe0OL2Q+39h1n+FauN5VP1lcSS9/VqBLBDQFrYH4uyJsi8FojUDz3HehQ1PkqNBiL6jzEYHapFQ64aE1XH0e5zN8p6yIsFX0PX+/g2/zHnxkTk087DhoK0oKgB3++fqLzUYNC4lpuMt5heXVAC7o64Ntl6vqB5pDbnKMfsV+fhKUkzgYpXEmkAlLnn8eY6gl8dHtdqtQs84UqkkUs2rIJjTpHKWCH1K6Tv3RsxTl7gU5QxM404jy25ogNFzhHmcTNOUEdNHfBD30A8N+aaNMkL+f/aNrmF9tmO9Xo= 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:(13230016)(4636009)(396003)(346002)(39860400002)(136003)(376002)(36840700001)(40470700004)(46966006)(30864003)(8936002)(2906002)(5660300002)(82310400005)(40480700001)(103116003)(40460700003)(86362001)(81166007)(921005)(356005)(36756003)(36860700001)(26005)(6666004)(478600001)(41300700001)(966005)(47076005)(2616005)(83380400001)(426003)(336012)(16526019)(186003)(1076003)(82740400003)(316002)(54906003)(70586007)(110136005)(8676002)(4326008)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 06:19:28.9024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 471575fc-24d2-4078-fae3-08da922b4085 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: DM6NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4313 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_231935_003843_065CDBF4 X-CRM114-Status: GOOD ( 27.66 ) 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 v4: --> None. Changes for v3: --> Corrected month in the sysfs-driver-xilinx-tmr-manager file --> Updated the Kconfig to compile the driver as a module --> Removed unneeded status sysfs attribute 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,magic1 value. .../testing/sysfs-driver-xilinx-tmr-manager | 16 ++ MAINTAINERS | 7 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 3 +- drivers/misc/xilinx_tmr_manager.c | 222 ++++++++++++++++++ 5 files changed, 257 insertions(+), 1 deletion(-) 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..2a97be6ae849 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager @@ -0,0 +1,16 @@ +What: /sys/devices/platform/amba_pl//errcnt +Date: Sep 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: Sep 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 f1390b8270b2..5fc5ec13985e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13277,6 +13277,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 94e9fb4cdd76..1508cc29b05a 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 + via sysfs interface. + + 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 2be8542616dd..4918f6632531 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -60,4 +60,5 @@ obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o obj-$(CONFIG_OPEN_DICE) += open-dice.o -obj-$(CONFIG_VCPU_STALL_DETECTOR) += vcpu_stall_detector.o \ No newline at end of file +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..39365e0cb6e6 --- /dev/null +++ b/drivers/misc/xilinx_tmr_manager.c @@ -0,0 +1,222 @@ +// 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. Error detection feature is provided through sysfs + * entries which allow the user to observer the TMR microblaze + * status. + */ + +#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 and creates sysfs entries 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 Sep 9 06:19:15 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: 12971049 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 7BDF7ECAAD3 for ; Fri, 9 Sep 2022 06:21:28 +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=kKVsMKJDRpRQvqD23bf3Y4jS+kqrEKASNi44wuHTw+U=; b=gaimeFPoc2hsVA +HuJpWk3xgTnqVl6LZxFBf5dnrPCA1axIB98hMr9puHld7zsRBv+2YPyqd8wO/l+IivuwvPmFLt5I 7WH5UXyQ0lNh4ce0ECbT39p0LoubmuaYVCW6Nhy7SlXSuirUW+Mfn6bfqmAAnZax40AW/hoez9ybO hMoFGDoXz655r8pAFOTiRzJ7x8S7Exy01iuSKFCRZWwrmymSAHyDnUHCRP2OhCTq9C31VXpU3aTcL IzssteJQk8U2N0h96KE82fzGo5tuHTd5QeKpMejyVTXAI/NCjsJlkPQ6noD8nqx+YdLJO6B3csD9B 5lLmZusBxi5zAzcbhPaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXN9-00DEO1-G3; Fri, 09 Sep 2022 06:20:15 +0000 Received: from mail-bn8nam04on2050.outbound.protection.outlook.com ([40.107.100.50] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMa-00DE3X-KY for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 06:19:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgVt/aFDGrQWaAE3cTMlBQqB7ti0/DMsNTDNJ2Pp5px7MMNNFDWtaTxcS6ujfviUXMK4C4+PnlwQFlzheys97KaNsnCtoWp1W/PLU1M5KeV2H9svRZI1k7g0m8h+RMUwF34ehukh1ztiANgkty6aje8vfPgr38npQIXypiVBUf1uSUQn6xezC1Wc5fX5LchBukffMcR3wLu21GdlvPmqfQlXZj+K74CZSeG+5OOirHO8+ErKKB5SxCVts/Gq1FoSASx+SrIvha7KnkjeoqgzL+bUQTPBJGCNNFpOjn74gbrQ6P5i6M0JqURFFcAZ4EncCzjGbQpv8vTYSIfFpxhSeA== 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=A3TF0emoDtd+u+PCHrd5p1zvlWOnt0vIURh6Rkq1OGk=; b=HBpibZwy6RI7CEaaqcvaBlLvZY91wpxU4bVXhL6lz5ytMX2KmtnzRNFbQ341iB3+DJOwMWWz8jz3Jv1FyZ6OGmBhRvD2use3x618rzOOMV0CnIoA20gDvax+79VhYAF1Qhb/wWL2jIoGFhntXTkMCZJ/fTYUMs7fXjxqn4fe2vTtJjaWW92YJcBRmyDcsr+XHHOcI1M1m+NOFQJLP+9bjGI21pMJDTntw9998laGWzUtmM8kADpnYR/BPSySv+CqTQbW25zZjLGH2qUn59sWZxN2oIJYzej+GdiUVeZUJ4Fc90/vHk+GDGv85yuOczNX4qdny++5PIf7xLC0jGEcpw== 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=A3TF0emoDtd+u+PCHrd5p1zvlWOnt0vIURh6Rkq1OGk=; b=0KqWrF9Wq/6jMRA0oz2kf/toxZelILd/rc+GhVJry6OCIGB5bbqasy86QIci3oWzr8H7iObQcQmOaTbyn7fk3yjVC7c682GdsQCpnz4uhjZW4jr/jMV6zsnnL+AyzSeuxf8046wStEuYJqmZSSaV+25ikDFSbgBmbiIrFD2g7xM= Received: from DS7PR05CA0099.namprd05.prod.outlook.com (2603:10b6:8:56::20) by SJ1PR12MB6170.namprd12.prod.outlook.com (2603:10b6:a03:45b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.18; Fri, 9 Sep 2022 06:19:33 +0000 Received: from DM6NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::a3) by DS7PR05CA0099.outlook.office365.com (2603:10b6:8:56::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.6 via Frontend Transport; Fri, 9 Sep 2022 06:19:33 +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 DM6NAM11FT035.mail.protection.outlook.com (10.13.172.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Fri, 9 Sep 2022 06:19:32 +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.28; Fri, 9 Sep 2022 01:19:31 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v4 3/4] dt-bindings: misc: tmr-inject: Add device-tree binding for TMR Inject Date: Fri, 9 Sep 2022 11:49:15 +0530 Message-ID: <20220909061916.2935431-4-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909061916.2935431-1-appana.durga.kedareswara.rao@amd.com> References: <20220909061916.2935431-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: DM6NAM11FT035:EE_|SJ1PR12MB6170:EE_ X-MS-Office365-Filtering-Correlation-Id: ba83f51f-ec8b-4591-10c2-08da922b42ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wlgAQWoIH/vFmqlvMkdQ3Ah5iH9HPcWDM6B34SlBiWhG+CS98VivgtFRfbT4bRJDsNUVbccnfkIx6SqbLkt7iaKNy82RpYqpnUSBQbZXUFZH0U7OfA7KZrTnqL+zeHk2kvOFrsWraCCNwt42cdinoYRWyC+ssobwPQm0jACueUqQgZ839WQiQPL55JMicIS2dKc/7AaOB+liGMsWrKyCYOG17OVd+okczDrzHDZpH5g7PrCOO0A4G6NY/7d1LQP+8pNBUsEeJhKujFIiK3UU/4+iik0NdiUaW73MRMK0d9ArFEwK5yTY0VnelQeQhyXVybcb+3Rb2HqHpIT0jMG7hJEvV2g+WloIlSo03jVzlfZpqBZtr4e3dnuQh3oWuf8cByu9GiLy7AI99YW6ul62n7Dk0+2uLWNAAdqmUdWzfWmhNO8xGsrSrzatkvRMQFQOcmmF00a8Ivip0jlv2bTAcLB0PZ16Av2ZDj3EoLJevC9Kj0nQy7jnfloKlHzN2C1TqcLC+5iQOOCBdo/wlgkDCJXxYe/q0iChpg/VFV69REf6dvrh4aTDw1WL3s+wPYh55sEdN/w3SE1yRtQgf88NwvziNQQhMi5FcR3oM1P0MR8OCVIAvGbugHGL71i0JgLx87+3dBEB0KBLyIpkk0t7IqkWgqTc6h8qaUuSYXu2ZQ8hllBRXWKWSt6eI+Nd4ma4KFgQKwKwok2rjzigYBDIF/fVv7xeI7U/9Lb8X3tQ4IYMz1B/KRY9jKoKO97maixQNfOs3YNIMBb21YiGGt+H6KYP7fAwRRMke2KZ0MDpCZqyvbjSxnXSqdhKDYczqVjuYnJNGQmAtz2+sbly/LcfpCIlHNRY9efBONRG58Tysz4yfx1N85VO0FRm1ZLGmdXYZdUkVWSc0xlOD2jwCI8CEw== 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:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(40470700004)(36840700001)(46966006)(2616005)(70206006)(36860700001)(8676002)(82740400003)(81166007)(4326008)(356005)(70586007)(921005)(1076003)(426003)(186003)(16526019)(47076005)(966005)(41300700001)(336012)(478600001)(40460700003)(110136005)(6666004)(54906003)(8936002)(83380400001)(316002)(26005)(2906002)(82310400005)(36756003)(5660300002)(86362001)(103116003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 06:19:32.9334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba83f51f-ec8b-4591-10c2-08da922b42ed 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: DM6NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6170 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_231940_707024_66E74849 X-CRM114-Status: GOOD ( 14.20 ) 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 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 Sep 9 06:19:16 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: 12971050 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 65E84ECAAD3 for ; Fri, 9 Sep 2022 06:21:47 +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=IfOP9aHy6+xmOStFBH/min1AUfiihdNRHfYhYHCyjoQ=; b=tAv/zAj9/IgYwR Z5Wz82aCIOyUGh+ppYjCB0k0p8qnjcJE4AX7nFPcVL7H42D8/oC+jTWNtIjZdm4oLRGWbGgQV0NXg /YyJIYdt1oh/bac1lMpiDhZ6dNtNPIrO9GWXXnqFB+uVL71utATlJkKk7OsZTIcltall0EY+h8Q5o CuLgfD1tYoawUrldJ1zjvA/dZQGHN1JITMlEzr6NWFKlScoZaHrkPI2XVeuhFmn+Jf0vn4rJsoE5f r5p3tERubOFgikwN6uccDrPRNFycn9CawlFTGe37ZmrBN3Lbey1/qtJuBi3WU//rZbBqw7Gm431zp RsjiGZpHgnI99gsctfBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXNT-00DEbi-TJ; Fri, 09 Sep 2022 06:20:36 +0000 Received: from mail-dm6nam11on2059.outbound.protection.outlook.com ([40.107.223.59] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXMe-00DE4m-RI for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UgWFfjvlVNGo4pfU2RmgIvWP2nskppkLa3tfSJnsfEzzqaIYVB234eIsHEn9Q/cyBujnfU2ksL+0IkZQ6FvdaBzwcERlQEqE+hmgZj33KNEvHf9f26NFx/Xqzs6OfRCAJ3VsE76VfZXZjKJShaVEhztiZgvZ0wmfyCfr5vBAHsMAGR2TocI/aude22xBwd9I6eumO1Xmd2IqFXKRJ/fGwjeUgtU6TzA73NgYC8YZQBSNw5D21mZrCBvfUDFNG5LdhZ/fveGpWZ0A10XGhfqBUmD/29WpY1Yku8LxtOt5FJhO3BcV06GIdSzbot0abCDi/f6WWWIOdBZeIR5VOFuTKw== 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=vRLDPzk/IXtkUOCPF6fxJxZ9+6NnXheVbiEM2Oup570=; b=ntyb3F9QrkxRfEDmYHbIYH/+CSd8C1gI5Q6Y/zw41oxxk7iiyTK47ZDec/Tj4TBYfQggS1vLVq3yGsSeDwjSJzNcttfJh9xvQXChlSFg4+66wV/a1TH888omyPM4qs/obpG0OIrqFwDl0trDYYa003RERDc9youoIaUQVeqlm6wlDdyLfqJy2gWjAEURxk+3Eod89P63cktd/5eG+9gWqZTXCxE8jCmhmHT+Tt8YWGXDSlLX3YrhniYm9l8hLGP7ja8hGz4yN73WL5q8Ej7RKc4RdHnQMOeh4GeI51HXAJlZSM73OQQJz8DiyUkTvn/z7vYwwayaBCskz6lpR73tqA== 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=vRLDPzk/IXtkUOCPF6fxJxZ9+6NnXheVbiEM2Oup570=; b=AcfcbObrUDWF2PvJeCVcptRl7CPqkRgOKzXGnUSRV6XFklJk2Y3cHULsRmmydn5don0tKbATF3xgmxoYUrqFs6f8FiDHEgfJ/Bqb+KpNSRRmCLyOz/guB4YdpkdFKkxtfwbDO2uGXf/hjMoJ2yR+zcPizf/O0saVt2uJbAmdqIk= Received: from DM6PR03CA0091.namprd03.prod.outlook.com (2603:10b6:5:333::24) by LV2PR12MB5800.namprd12.prod.outlook.com (2603:10b6:408:178::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Fri, 9 Sep 2022 06:19:37 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::4f) by DM6PR03CA0091.outlook.office365.com (2603:10b6:5:333::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Fri, 9 Sep 2022 06:19:37 +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 DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Fri, 9 Sep 2022 06:19:37 +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.28; Fri, 9 Sep 2022 01:19:35 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v4 4/4] drivers: misc: Add Support for TMR Inject IP Date: Fri, 9 Sep 2022 11:49:16 +0530 Message-ID: <20220909061916.2935431-5-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909061916.2935431-1-appana.durga.kedareswara.rao@amd.com> References: <20220909061916.2935431-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: DM6NAM11FT082:EE_|LV2PR12MB5800:EE_ X-MS-Office365-Filtering-Correlation-Id: cd72e09a-e148-4a42-3f38-08da922b4597 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9LAb4UAwEavabKpAtDJ2wAnlEHOJZUY4OiFNMH0E0XgTDfkML58cFw2k7NfoXHys0oIkDe/p2ugVoD7+T0v8gozGcBmsfj8JkdF/Tj67Rr+ZA8yWMXxfBaHaL18JyA8jKngLO3Q53Rae+i2UeDfHmkFNq+WKwhN4n9DemhWyRyYBgLi3lTJ+165IwMfgmWYHGcNMX7aU188/qMStFBdgclFZ0yqQpwYrpHAi08IbvQTl0fqOdtPD/cUkYtvrpxHU+oN303BIk2QnaSutUVnp96T/YnHBK3q27ruaVnNxsL0ICjRT72twur6ssBSWl6PQCBCZXBO08CRuQ4+iwK9FnJugHRm02iHCKebpVBrHMu3JAUXM7pbDWEss2AiB0RbYdRHY7B6GA2h3qOJKzp3njCBi0h+uTi5lOfyvnEzfj5mCvAOU0MsWVHOAAQOWce6ABPyT0K+4UcW7ywPEaddGCi0JvKo/2waysD1NHc++0aA6mqWsrB7+h9z1r8o1IBF8fjUQW4nGifg+Y0/VMbYnw6hM9TcgzRXscNA5bhTBosp5/T/PTV8K7zicHcZX04oIDo/5AZL9ZDBj5eYZX+qgJZ0kvfjvUaXu3LhcUuEDo+KUL7QxwvGQ7llvJWzD/WAi3huR8igzs1TrR5WSpAFGo5HhFkmCWVSY//XucSABeRISRm89C+p9jWevUc0RL3JL0j923XQvo5E/NP1Xn+86JlzWKx3pHIMS7V6UhGlojj52ZigNAAQMZ8zUYCw3cejn1i6PMElT8vGtAPR9ukQZ7tXH33mn5RKn8w9UvNKQWjfPd71OzilLHxPGKCwM/v0V 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:(13230016)(4636009)(376002)(136003)(39860400002)(396003)(346002)(36840700001)(46966006)(40470700004)(5660300002)(426003)(83380400001)(103116003)(40480700001)(186003)(47076005)(2906002)(16526019)(2616005)(4326008)(8936002)(1076003)(70586007)(70206006)(8676002)(82310400005)(36756003)(86362001)(316002)(110136005)(336012)(6666004)(54906003)(40460700003)(26005)(82740400003)(41300700001)(921005)(36860700001)(478600001)(356005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 06:19:37.4041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd72e09a-e148-4a42-3f38-08da922b4597 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: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5800 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_231944_981495_2701E943 X-CRM114-Status: GOOD ( 30.99 ) 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, provided sysfs entries which allow the user to inject a fault. Usage: echo 1 > /sys/kernel/debug/xtmr_inject/inject_fault/inject_fault Signed-off-by: Appana Durga Kedareswara rao --- 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 | 173 +++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 drivers/misc/xilinx_tmr_inject.c diff --git a/MAINTAINERS b/MAINTAINERS index 5fc5ec13985e..1207effa8e15 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13284,6 +13284,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 1508cc29b05a..9f8372497ad8 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 4918f6632531..fff8606d505c 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_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..da42cb1a0ee0 --- /dev/null +++ b/drivers/misc/xilinx_tmr_inject.c @@ -0,0 +1,173 @@ +// 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. + * Fault injection and detection features are provided through sysfs entries + * which allow the user to generate a fault. + */ + +#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 and creates sysfs entries 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");