From patchwork Thu Sep 8 04:24:41 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: 12969639 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 153D0ECAAD5 for ; Thu, 8 Sep 2022 04:26: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=QWsQcztp2nkZVFzuY1w+sQCwDx3WqrwRpm8V2OQtx+0=; b=PvGYnoWhgY9HF0 noDFbzzzwYXacMlZtcVcU6mt/av6UDTX1WPL8/xETjSwgujKDK1rfm2rNhl8mbVCqKGrCB0k+RHSz JS7DEaAFDNc2mMiEL/ncPAIc7GwilV1e3sbYQ0sSzQ8y0e1AD3iDs51p7G2KQ7PFPzT92h37K5q0j +IkRLpTI3ckyPrUlyafZLB4+75AL7zgqXMftPLqBqETMhzBPDU+2Jn8XbnDMJeYRzrnP2wHPLXGb9 WMreRICf85CW0YoKC/Id42bIg03wQCrq+RoVzwy+jPRQoKafGo9MI4WjKKl/BC3SUOAGb8eYPjhzS CAkigpMNIw98MJJ7xkww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96E-00G7AD-SI; Thu, 08 Sep 2022 04:25:11 +0000 Received: from mail-dm6nam10on2059.outbound.protection.outlook.com ([40.107.93.59] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW962-00G6mc-TW for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 04:25:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mOaTF6jTgSouQ/Ft34Z3E0Vjtz1RpqOUPW+34OMy9gO12kvfzameD7HrWosKTy7A1cTYG0bbRLPwWUDUFXHoocX4YJlFj0cd8GDk+zHxel7wEZNYreoQszdsOps8PuztvFnFX7OMwLVeF0+DVbqLo4iXk0bVxMqWlJ5rCPpP6Ihtgs3IybALrM/kMiuUjD8ycahgCLQeRcUnf6bHzJ03ycb2BFfqpp1jXYt+VvQLIhUc1C/GOBUXC14aEl8HWvusCldr+A5qjLsnzBwrgxBPd67FhuDOp/2+OQcnKu4jG5vsJParBsf1hyiJzXZv9vEaiI3SUHvHfnVIf8YGe8cddA== 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=9fRNrDBjU+Xi6Q0mBfmSV7zV6Y0Nos7jIK7OZYoNHWo=; b=aexmZ9XcfawrZLNtVvMOhnyX4Z+UvaC95N7FHxD1YMwM7HDpmooC4jOpnzChmIgTawh0A387SUGXFv7Sz26K+hXnDG3xF3E81PAZP7v75v1E7DHsMv0mTaCTasAo8dIMhYRAK8wRRdbaafNV+0eQlp2aPvVcENme59wRTrwmZb7H0mzUt93y7Lp7ZUOudkJkq5oYDOA+jFMxLAB/QwSDaxPmNf7n25t211DwwnG0dT1PSeCogD4XsoYyLI1FmwhajhPErdHFV/CQAWdq50/H70GTPDD083j9q1o7AMjeGHwopz8O6YkTCTJE6gqKhcoSVimZv4XUAUokcKZ+2X+y/g== 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=9fRNrDBjU+Xi6Q0mBfmSV7zV6Y0Nos7jIK7OZYoNHWo=; b=HrNs8aWIE8wk8j1+J8wYM5mDPQ1XINUbjcQHbqEhVg48kmu3J7yyxUoHC+4QV/6lfuW57lUIwvVnAUvgnN1/WgTOEWRR3n5a3Yn6vkGyoxIhjrvynRKs4xrxumESMeR5DV2qb3C4vAi8/1u4GmjjlaCEcg00zlpNMncFlVknVoQ= Received: from DS7PR07CA0010.namprd07.prod.outlook.com (2603:10b6:5:3af::29) by BL1PR12MB5079.namprd12.prod.outlook.com (2603:10b6:208:31a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Thu, 8 Sep 2022 04:24:53 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::99) by DS7PR07CA0010.outlook.office365.com (2603:10b6:5:3af::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Thu, 8 Sep 2022 04:24:53 +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 DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 04:24:53 +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; Wed, 7 Sep 2022 23:24:51 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v3 1/4] dt-bindings: misc: tmr-manager: Add device-tree binding for TMR Manager Date: Thu, 8 Sep 2022 09:54:41 +0530 Message-ID: <20220908042444.2866731-2-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908042444.2866731-1-appana.durga.kedareswara.rao@amd.com> References: <20220908042444.2866731-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: DM6NAM11FT033:EE_|BL1PR12MB5079:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b71039f-eef8-4be1-6fb1-08da915213ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iDSuSOQLEvR5n8cyoyNRlmKrtTddaj729zYln3joNp24uPbDOaNcyJDC6iH6UakK6ymzgNq/NkT6aUzwhX0oaYH80tKqMiz9Nc7r+k2Ry74gJG4S5Nhr0Epf5Bi9do+9X4iDaXKMzXZ5EnI9n3lZZP9o3d46YFHyTwKp9Rev+T9wkSgHK0b1ZnjCuXiHWaSpAQSKL2qMmnDEuNrNdaumVLD44S+HLLJ6vbJiReTsypaKuBKCkTeLWbHvV6RqPJuyE6P7gb/5FGm1Xzv6bg32ncHwdmRV8fJzFXl+yr5azsk4WI85avFfGyG2OqqmVZNr340OGAE9j1Q1ofKukteJoMe5dMzVnDVePzxwLYR6q/d4lvoodW0CrMqA/N4ODK/IEFZWKOg3Q+DpbhjeMibUflmB3Go+qKcHJYTuQbLNL4Eod1tYO2cDe+3nxUiT/JqHl9tnPOGUuF+EqrgkyBaZdVWseSl/Pp/XwxNCF1DMbQ+WxG0rwhztgXOUKI9xcbt9oj3hBr+L4PzMw/UpaQm91bm9obIKZx+noztgBcXXfUB0IFsBJkxlK1NPwq8lIjarjD3vvATZ5RP25GGdfAvR9i6s7vHNryLvHhxB2l3CwIi/TUprMbd0yZQFNL0Olj/xrfd1qHbAghZkC6frXt8Q71h9aYCAYltRqVLlCmnGZkKtOMtSx8K+YYL4gGfBFj16lPdFibskGzbguOU+4SV6v77Bl6aNn0Irsr7YiI5j/ZP83ST8+gE5NzmVRYjoqLgMG1kgpPBfzugGcqckM7cgiltyIM0NoUC3zF76CkqO2Xil7KUa86rpaLimS6+wtOaUnVvsC2yvxAwV0sQtvveNQ6buW/5qLaf76RduU1Q7Y5SisNb10m+lLE3gBWoy+h2TDMrKSrNYSE3r6HBaezNgXA== 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)(346002)(136003)(376002)(39860400002)(396003)(46966006)(36840700001)(40470700004)(316002)(40480700001)(36756003)(82740400003)(41300700001)(82310400005)(81166007)(356005)(921005)(54906003)(36860700001)(110136005)(103116003)(4326008)(478600001)(70206006)(47076005)(5660300002)(70586007)(8676002)(83380400001)(966005)(336012)(426003)(16526019)(8936002)(86362001)(186003)(2616005)(2906002)(6666004)(26005)(40460700003)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 04:24:53.3148 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b71039f-eef8-4be1-6fb1-08da915213ee 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: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5079 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_212458_974019_35357064 X-CRM114-Status: GOOD ( 15.41 ) 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 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 Thu Sep 8 04:24:42 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: 12969640 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 09D9CC38145 for ; Thu, 8 Sep 2022 04:26:33 +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=oVbxUkesylOX6X15VJhZTGSyB4BVhJmW6cpEFUqmoVI=; b=ZifyFRnwOVM04g lKnkxs4J9kM4YG0UkItxXRKl4G2g4ghjEyjpJ8oMhgDop027DcGMFsp2bvMoQdlHSPlCwVcS2JByY TbxbqFK7idH259jyvmbBZPdEjs7I3Bst0IKyVZ+WXwuOrKaEQcspdm246tQkRuhbLewn9pvQ9lApP KM0OUEq3JoNAol8+/9a1KQA/LN0CPNVcp+FqQjC/Z/jhUsGcoEdUhd01xz7XWI8d7Cix6SAljPt/I m2Fyk8E8xY8uy2Mb6Bvpn4ZfE449hCDY2PswWUHpD4w4xvunTErT8Yp319ovx+W4WS+n3ofc7UDdz SWZFgQ0bOBgDVs7NGlRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96P-00G7fY-4E; Thu, 08 Sep 2022 04:25:21 +0000 Received: from mail-bn8nam12on2051.outbound.protection.outlook.com ([40.107.237.51] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW967-00G6pj-Cf for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 04:25:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gEv6Fjk/WiGHhCrHvdPcWfn8cbMKWZfcyBCNE9wsTl6JlYpcJM91yoPlCilbFNkeDxWeVMJYkl6ypHkLl6W8dnfEr6HW8fVTKP6uCUWqNZVUARZliaAmdHtpRK1j4WA4dyt9HamnRWqrhS2vkGX1XoFygd7zCXwrOOtTPz8xOdjCWG+l4+NmOBmIu92+Bntq4c34I4y2EFtzrivb5b/le/PzymnbPhOwOjbmtolzUJxusT/gAgo7BDryqQengLZPG/KtorLrVn3oaJIdC9PNgd/t+lMJPFawQXGl7p6ieykLGRTE1QSx2fMDYnr7lS1eRSkYlie+mUmNmOaomfVSHw== 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=DopDLmJFB/bCR8e9MRQii0LDTZIJxiq380/86LIty/o=; b=XmDIolqMe99+KAdhAz8TrALM2OlyNY7uSgdM57k/AbbLEyzizs7DfgZFB1yfpfKGkkeJ5n8a3mUD5L2UMM/l/ZPHiBTcuXgsKa55Uc5BaHUHusqiv6Qof8WFm7wbSjN7yTmCmgr2799FWaK0XFwXv8MMSaeTtyQJmRF/V6cxkCfXv6DPOJkPJxnO/CKJkGDhqTEKqEK7C94mbefEoZ9eeIdQpbPFi2hHIJp41ot/sk2ZwG1+WQy1hToaS6eBQKG6CkI4TpwfYtItmYDwN1gLs8LztTlZ9cSAScMSW76EX9+ljDxBCj26+VtP6mgkuvOJsO/jmYdQjuDw6A5BIU2khw== 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=DopDLmJFB/bCR8e9MRQii0LDTZIJxiq380/86LIty/o=; b=1wfd62Oxz6bw1/+ELR19JXzQcvg/7dBLHhBEH1F4nv0Icq5rDH2Wrz9y8lj2JTtlzo7N/rdBPR06qaII+P5vPzlFuaQJNXgZGvHXS2fAQJaFwT4msSXm/rWpzpTrCvQxRvW/8TcImbF8GzDZNVGsJx0x20cuVnKyZDKRrvfTGz0= Received: from DS7P222CA0002.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::30) by IA1PR12MB6308.namprd12.prod.outlook.com (2603:10b6:208:3e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.18; Thu, 8 Sep 2022 04:24:57 +0000 Received: from DM6NAM11FT112.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2e:cafe::27) by DS7P222CA0002.outlook.office365.com (2603:10b6:8:2e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Thu, 8 Sep 2022 04:24:57 +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 DM6NAM11FT112.mail.protection.outlook.com (10.13.173.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 04:24:57 +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; Wed, 7 Sep 2022 23:24:55 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v3 2/4] drivers: misc: Add Support for TMR Manager Date: Thu, 8 Sep 2022 09:54:42 +0530 Message-ID: <20220908042444.2866731-3-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908042444.2866731-1-appana.durga.kedareswara.rao@amd.com> References: <20220908042444.2866731-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: DM6NAM11FT112:EE_|IA1PR12MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 58ef25c2-39e1-4268-264d-08da91521660 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Ae0qCkaAOpSuXElq4u0MryFjn+NuNw9BKWg/JvyalYvGnuw026WpvFqQPRoa2zZ23EmdC4TwCrtOyEU6F3KajkoMla0D/kFPfaDROFMLO+qBr/SvbKDoRBuZ78t25+5pb/nDpp0Sb617SAavjxH1q8z/kmXdjfJi7Ss5C88s+uchZej/4uMFqhI4Vty8RlT1D7fXlaUMg9XiTPoJtZpv41nUeB1zNgZ4GjfK9voW8dG9UKnSInOvRLO+sTtv4VTIWniN5DtDwFggKEGbqvMC8FikIrOPXbmnE7hSTCoZHbgXFXgTt9zztzxHDld81iNLwNP5ZGYSYt6xmpsAjmi9BHRy/11pSh6Y1K5DQfNiWC1lnVWHFNJXQCl3klwvPThn2gxv0KhHPzX4P5vDZFHo/6CsIsf6WVfWtchbXkL0XdL1Wg6HoQ/DIfR54VkwMaB3kIIqftlN7cV96ck5dj80OvxqZVTPWLNx/0EH4V2Ss22ppSHpgG3jNGQaI5miFh0Cu3o8WitS1ceC5e14Vf9j7mrM7TAq4/s8dXoTqW6G4k3Y6mYe8fQijPOk+yAcpnjqGudXrh9oXjnmdedm7ZrLozTtgRr20noquiGOFQXmRYsINUrTEgAJGnmzMR3eDPhaD4Uh568ZmRVbRRRYWK4LUM/Rec3ebFROMQ9v+dstybVcY5AhGfVIrU+5T/SojZ8C2apsl7KQ7452vxanA3GHPUSQyrZ6f0q3tlLmhQWFeq4IYhAeaOyZJhKa9JL5lyEqv3a1h86fvAJLyun4AJ2XgxGd9lGZa+ojAzbHvfoKghkEZAyWu7NmRFXq0E6ehsPQdn78meaVfd8yQZHltsQpX3m6HtjdRe0O8bXtSzi1IY= 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)(39860400002)(396003)(376002)(346002)(136003)(36840700001)(40470700004)(46966006)(70586007)(8676002)(83380400001)(4326008)(70206006)(6666004)(41300700001)(82310400005)(110136005)(316002)(54906003)(2616005)(186003)(36756003)(86362001)(1076003)(47076005)(426003)(26005)(16526019)(103116003)(336012)(40480700001)(5660300002)(30864003)(356005)(36860700001)(921005)(2906002)(81166007)(40460700003)(8936002)(82740400003)(478600001)(966005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 04:24:57.3686 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58ef25c2-39e1-4268-264d-08da91521660 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: DM6NAM11FT112.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6308 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_212503_530164_66088473 X-CRM114-Status: GOOD ( 27.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Triple Modular Redundancy(TMR) subsystem contains three microblaze cores, subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. TMR Manager is responsible for performing recovery of the subsystem detects the fault via a break signal it invokes microblaze software break handler which calls the tmr manager driver api to update the error count and status, added support for fault detection feature via sysfs interface. Usage: To know the break handler count(Error count): cat /sys/devices/platform/amba_pl/44a10000.tmr_manager/errcnt Signed-off-by: Appana Durga Kedareswara rao --- Changes for 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 Thu Sep 8 04:24:43 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: 12969641 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 8121CC38145 for ; Thu, 8 Sep 2022 04:26:43 +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=8MRRZgprg1NrACrtFwP4RuzRBnng3DNLfbYI0JZpsNA=; b=QcVEluw9eeBQxq 16QaxpDFoat0S35PD18zAzPoV79qbH54x1Yd3ubSFpUqguRwObYUV2mWnV1ISaPgxvSibMEDvMlwM JwIGM6ZZ1QVO8Vh5DbvkT7nXrsohF3nkcfKLKs1ZVVI171kQ1vZG+VkeBzB63t2jp27m09c2Hkg28 TyE5hSaydUIos2NaJwr42ojTrhSzP9l1/1kHMJdXwtq3DsZwvgBfZTn5ApSsRk6IM+he92/0HK2s9 IPlNBjvCI46QQtPK64Ln4/ynEUvq0zcPAxPfE2RnqCpCFWmZQAGGPboK91asXrak4a2t+EmgCHaD7 PlsjEXMQMQ6WKf11ARjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96a-00G7y8-EY; Thu, 08 Sep 2022 04:25:32 +0000 Received: from mail-mw2nam04on2054.outbound.protection.outlook.com ([40.107.101.54] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96C-00G6zs-J9 for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 04:25:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=egJPf1JQ6pQW2SUOGjUSbICkD8oKYWfLNU2qylfueWdANxyjVMPW4DPuFbpIESCEHGGJ9TEsVxqgqkBNsKnyyxK/+FMrFLZxFmZTl48+cGaXFE+iX1+T5uHODCzDC8yCrGPx1XMqEsEeewla6Q3c4TqmFb/ngqc131JyB7iPbt+eV0OnZLOJSw/ejr1T86QrWGme1YUOe9X68qTM/UlYfjAEOj5Pgdc/WMHzIZRLRLjg92GyjoAX5f/zljFdLGm0F+rzAm1u941GMw4jI9dvHbsdn9MRF4WqE4dG3h8l8NaXYlm0EWwVRxE76sinLDoaxeODqNNNEmBjOmryrc5f9g== 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=jNgq/gBjrIImodgMAj3hp+1BRtrQtN5eg+MQh5MhSSg=; b=NibHLuEa1iCT5fALIQknuiyRqjIeQnNhfcRJA0IYQUpLTc0Hauo0GWUZUZ+HHknGW4FHsLC6ze2q+s4/0ypLdBVhAcNgGFPQZfsAV7IImZN/4yqeedXh4xmMaU4EqbC89XnH0VJ0rYb1ZBIN9O/gHtfY6tIXC/FRhS7E1Fa0o8NqZ8SI8MXVH+HnZA+SMgQzlWezdWNMzihWYADOsAxZd5JOcq3HNmwxhv/0q4udeaK59eEzDD8b+TzNbfn7KdprLPl0NXjuBEbIhh3eANPzTXSYNLRNDe3t9wLvUzAr3FACBR7rJgoDopi7oZjnU/l3L/L5MZ/i1/GEx/AasrwSww== 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=jNgq/gBjrIImodgMAj3hp+1BRtrQtN5eg+MQh5MhSSg=; b=kw9M1kzmMkUMyumNpA2io5IDW4+Vx7OFNUJykkmp3aOXaZLrmXE0ZYzZ9yb2BzmlCAyzEVjbiWve/xHsL1Ab9HaqOhoVicw0dYoeXpA2l2IPMt6AYcvp8sL/UTOZ/L7YJdUsQyPzO6mQhvE7EeLblovjvIoFSIqS75uawOM6UYE= Received: from DS7PR03CA0252.namprd03.prod.outlook.com (2603:10b6:5:3b3::17) by BN9PR12MB5081.namprd12.prod.outlook.com (2603:10b6:408:132::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11; Thu, 8 Sep 2022 04:25:01 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::2c) by DS7PR03CA0252.outlook.office365.com (2603:10b6:5:3b3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Thu, 8 Sep 2022 04:25:01 +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 DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 04:25:01 +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; Wed, 7 Sep 2022 23:24:59 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v3 3/4] dt-bindings: misc: tmr-inject: Add device-tree binding for TMR Inject Date: Thu, 8 Sep 2022 09:54:43 +0530 Message-ID: <20220908042444.2866731-4-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908042444.2866731-1-appana.durga.kedareswara.rao@amd.com> References: <20220908042444.2866731-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: DM6NAM11FT049:EE_|BN9PR12MB5081:EE_ X-MS-Office365-Filtering-Correlation-Id: a8181405-0bfd-40dd-2958-08da915218f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LWovrFBEaI19AzIW0L9R1RtqDgNj/XjG8n6Ru6pdqbIPb/YmOunL0YYgyn/D/crG/mBTf34hL1JOBiFmdVabUVqX1XuEdyRaJmPjyAOeelMgt9lytJJDESuajPRYrKpuG+r4IZSkRR1qWKmIZ/RrSC7b6U5i2gSL9X7ltc8e2hJ7nsMasry5ljbPEpgV9qDXG9RVznpDvoHUlwLuUEAaaxnH2XTr/VeZkmmpp9+zyXi3BAzsDxpyJ3cTigDlDT4tugXHW50Nvh40EeW2lXM3+dwEHI1kshsNHvJehj34Vs+mNynjQsQThh7VhzekMSg80OtRsKs/1q4nE6af8SZ7ro5Ul0Z30YKhQ4XvxYGpQwZ6tOnYhiWfl8J0rm/iFUe8xtdYdlt/Hr3nhBi6rQ4Q+xc4QcW8wmBt/HF/+ai9/NLfhkjViBSCcmGRSDPBSAHV8EXeYWPeOArjchpRfCbFYci6cbuwp+nSTZ+wVgD3dsZ513HezaHPh+PEDG8uvSIfCJkaqHW93AeY3vqCsSGoqFnPeWF2noHRQUpDp6THOBAphCH5g4RNUM5S6BorEtvo9tDD4mF4Qs+QAUIa2IF5njJ+W5C+tFu+Tc7rhy8ECgM9K9+2KrQW3Dx7vmbtrr6pegeJK/DxgblWvrDbWKyv2tRFAvAvAvbQmcoHWEakNHvL2H7u1cMKh3wUtAKwv7ck/tXY/CJgGgFj2qCiKrDtWULzKWbA9T7F4UNTkknJ2xEfy8KQw0SdITPQMFAxJtKsuWO8n3byoDY6o/k/4HJ4QRd/gP31aw1tWijzS4+ud4FmO1IKDyj+Vh68ZCMDoslhgVwvqmrm28nTX2eelsi7LfRdo3KyzCgCQRw52edIrTkHUb+QsOLPtKvjugCYMz6/59fTqEXjSo3qa02U1dzbSQ== 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)(346002)(136003)(396003)(39860400002)(40470700004)(46966006)(36840700001)(41300700001)(1076003)(186003)(40480700001)(6666004)(47076005)(478600001)(966005)(2616005)(26005)(82310400005)(81166007)(336012)(426003)(16526019)(82740400003)(86362001)(921005)(110136005)(40460700003)(356005)(5660300002)(83380400001)(316002)(54906003)(36860700001)(4326008)(8676002)(8936002)(2906002)(103116003)(70586007)(36756003)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 04:25:01.7056 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8181405-0bfd-40dd-2958-08da915218f1 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5081 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_212508_671947_6C4FCEF8 X-CRM114-Status: GOOD ( 14.36 ) 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 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 Thu Sep 8 04:24:44 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: 12969642 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 8CD8CECAAD5 for ; Thu, 8 Sep 2022 04:26:56 +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=x78Pji7YAem/ZH1dIX+8729dpOl713HGE7u32pQKuhs=; b=vxDiOGeO4rul62 Y3EkqFhTde/mAoAKPybC0PUh3GGrb/wxTa+fzOTYgoUCILyovDv14d+8glTr9YzBwVTNcs3VCwTrZ AY86QKEntAiPs7pu5o4XsjV9dkV1SU4cfKYjodevTeepBdN40SCIFscYo+e5m24sbY73oyI9kdKFx U58XI++UWoKM+ywiMFCEtkwBevdvmBQWZRRE5au1qU8sV1Ssx/2SDMx36XXf93NaaB+fd1EmKiPfj jLriwAgpJpgFC0d2b5StCCDCZrUz43zz8bjTX3dIhIE7xGCOPgmhJRbPYwR1HKZ2op6aRh/dMzC4q XzazV43DqbzRKJo772gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96m-00G8UG-UB; Thu, 08 Sep 2022 04:25:46 +0000 Received: from mail-mw2nam10on2074.outbound.protection.outlook.com ([40.107.94.74] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW96F-00G7AO-UF for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 04:25:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eShFNDJ48+pSoa2okmwafjZ5qKcu7NK1mS6mdl40sGx0vlnCU8eqJAZSsq7pudhy8nRW24lf4eoJMoOCWBTWuhjeugokOj/Qw2odNWK3zx7oaD1mZyc+NiOZlJvl8ByqKkA6bbRsxX9wymfx5jw+m/Yrqbwy4ea/vAqviloQmrmFkvCwiani5eAo7/Bq9c2v+cPwTmNLJ3SyDz+er1OGElquavREtfqzJqfsT8KIGJc++DEWhM6AP4BBkV6qFtEsgzGSkpv0uSNONZ2Z50X89hpXZQVuRNJMknc1tOq5jBk713ii5cUIy5TtsrBUuUDZNcwtOd8OMBfB2HUQuju68Q== 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=koIgmqL31vXL9SrVoyp8TH578ccyX4B69TSOV7c31Tg=; b=dmPORkJQQ/z8t9T9wxGrjEBO/dLKgXHoG+5NX/c3nSS4vtvJrCmDL2k97NMsZLmJOFmWXjricYXVMRPBMTgdITNId1qHMmScdd17gfCFf3E7ITTnWGAU2xaqDCGoPWTQn0x8PZ2NsB5YPUnMo7X5q+0OsEP02Cbn1JlQdU2AXoSPJHaoFYoyZU9g81nrFJ78yUKyGXFSlL2WmNcO66BzTWkQDyC0rpeJDrUw+XlUKOM8+NQkze1mg+rcEzbbXEbokaabHO03ABxQTBSRsGr4CnwTfRSa/WLwYbniTrt2bxR6ogJxGIYNX0ft/2j2lbSh20qfpgqSttQT1J9Vu64iew== 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=koIgmqL31vXL9SrVoyp8TH578ccyX4B69TSOV7c31Tg=; b=xRTN6MgWvj/dl2r3VHtwT9CjOwhjhJoS8DpXSdfzze5lXh9Pr6Z3nWaR/acIbf1OG3rrsb/f+LVWkZy068Nz+vhXT+bcnYplNsDWMfRH/3+NYqCqoYPRSHBPrbCA4XBexV1L8CAPnZo7MVMxjl/MkudQ8p3NlPHWlD6HPO3mlmA= Received: from DS7PR03CA0269.namprd03.prod.outlook.com (2603:10b6:5:3b3::34) by MW4PR12MB7357.namprd12.prod.outlook.com (2603:10b6:303:219::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Thu, 8 Sep 2022 04:25:07 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::5f) by DS7PR03CA0269.outlook.office365.com (2603:10b6:5:3b3::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Thu, 8 Sep 2022 04:25:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 04:25:06 +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; Wed, 7 Sep 2022 23:25:03 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , CC: , Subject: [PATCH v3 4/4] drivers: misc: Add Support for TMR Inject IP Date: Thu, 8 Sep 2022 09:54:44 +0530 Message-ID: <20220908042444.2866731-5-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908042444.2866731-1-appana.durga.kedareswara.rao@amd.com> References: <20220908042444.2866731-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: DM6NAM11FT049:EE_|MW4PR12MB7357:EE_ X-MS-Office365-Filtering-Correlation-Id: e4f74c60-7c7f-451b-98d7-08da91521bd6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4aC/upV3EHc6Ch1T9isuEpiXRq1JaS/FHcDX03oaOHhYtWq16YbNRNlvTDcRbuwDCUFj0Yv4dq9XulyTBPeZUJvY2I2PlqZOQ0PaptOXWcFOZFKOuPZC3JHWcNJm6TidVd0JjcUlAOABF9og4PN0wbLVanvgP6AWbIbl+wGUMJ6c39UJg7F/GmMnYoaO6UY7grHzV7WnXKv5grApovfW8/1izPt0KoHEb4S10K9vJoiaJVyYv8KcYatCk4DEx6ycJa5lnNOvV4Rg72Adeh2CP68mXWsaXxgkUAs969x2WsvuLfHGGMzSNY3uV+LSlB7yoxNDDAEwY1yKTlX1PHCeql/NIgxzTaoZpB1Ro6IVj5WudIj169jqOTpcpbcOEv6Z7mCjR2FPlCiZESS1T1PqNCPlKDVXrN0uMLhOAWxCKZejBW7rQq05pWOqgFvwvldrB2z+h4V/DPzXHuFoZoVpZirtcFwpunpaUNZzACNPyX1nsXY8xq3jOxjAbfRkH8BoHRyjBUof5rPA4KSA9r0urr5B4t/TuUw3rAkUF+Vwz9sQB/cJHqCZuSq55PPJJSJOJgHulDlVS4jHblAijF92P/x9WHCPRlYkBms/mCIGPaVNePLhoUgSjXb28RMSWmXxGCKZo4/Lls/6slgmADUxqJsb4Zv7wwDypWaouCHkIUPj0OKx51ubf8xSRTImtlgbMC8ZzVtguAMewXpV4s0qXYJo9LUdkxudNdsHF/W3J+HwEgw4q9vE+4akcfPb44nJ6qeA9BwVO59mJpq53rt7NGfoImVLgbqO53/OXqq8NvHd3FVP1vQywGUr79gZ5WjO 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)(346002)(396003)(136003)(39860400002)(376002)(46966006)(36840700001)(40470700004)(54906003)(316002)(110136005)(36860700001)(36756003)(70206006)(5660300002)(103116003)(8936002)(2906002)(8676002)(4326008)(70586007)(41300700001)(82310400005)(86362001)(6666004)(478600001)(83380400001)(336012)(186003)(1076003)(40480700001)(47076005)(2616005)(16526019)(426003)(81166007)(921005)(40460700003)(356005)(26005)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 04:25:06.5647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4f74c60-7c7f-451b-98d7-08da91521bd6 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7357 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_212512_010873_6125598A X-CRM114-Status: GOOD ( 31.11 ) 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 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 | 181 +++++++++++++++++++++++++++++++ 4 files changed, 198 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..7b1930a7f18a 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 + 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..592e1861c1bd --- /dev/null +++ b/drivers/misc/xilinx_tmr_inject.c @@ -0,0 +1,181 @@ +// 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"); +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS +static struct dentry *dbgfs_root; +#endif + +/* 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); +} + +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS +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); +} +#endif + +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); + +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS + xtmr_init_debugfs(xtmr_inject); +#endif + + platform_set_drvdata(pdev, xtmr_inject); + + return 0; +} + +static int xtmr_inject_remove(struct platform_device *pdev) +{ +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS + debugfs_remove_recursive(dbgfs_root); + dbgfs_root = NULL; +#endif + 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");