From patchwork Mon Sep 26 10:13: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: 12988544 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 7E6FCC32771 for ; Mon, 26 Sep 2022 10:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v5PeX6FVsftGQ2cAanjlTakdrotEbuNmmY19qCNRFh0=; b=JDdmNS8tdbAVXV DLkioMICgVKaM3NKRBIiQKqk3PdgTEU+8VYWZumPzDVZh+yimoYYQ9BMk8S3We4kk1VYyHa2jLSW7 McdufW7oVuZzEwGIeMu3s44vLSIFatglx7iN6iKooehtJSER414TDRgVSAhQBRbnP8LOQV/B8NfCJ qOkkxhSJeysypEPBrTXRmL7RWEZQq5kOjphUcK1zG81ingPn9TXQLAwy8PMeHfymrkq8jCb/qdte+ trswvlWQzyid/ZegSzxPDg6Kkcpynd/QaA0Dz9AgRv7Rsmfghgr6FnT1Ouied9OIZ8fw6a5N+hvji 6PX2kXDVHLeWaq6qHCgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl92-0040Yi-0D; Mon, 26 Sep 2022 10:15:24 +0000 Received: from mail-dm6nam11on2066.outbound.protection.outlook.com ([40.107.223.66] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl80-00403q-BI for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 10:14:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrnjUa2bVqvyQs+v/kYJfHxibmH0ZdbMZhi61nv0y18pjSgJgibwuqnE/kYcQHYn4oH+DhYuvBqBGjw7Y3bPvwSQJq/RxEwm0quF7VgkBJxntFBXGogH2Y619he0BAqkq2vvh+Px9ItLR+qvAN/X8Qg02t/QhOIQBLKC7SBn0lUsIsbM+bAYLg4l4KLnaKF3zuK6YPPM7tqHJ4X9iU+UI+pQXzFbcSVCt5IBDvmMLlMdUDmqD3bFHam1Uq5Kv7dm4uLCzN7nhozWBPgbrlNblVaLRNlOl6nnlArxx8pCPhmlrG8+qlscEsdhzazEbi2p602kjS9XVyKvcs6oNKXRZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/0glP/0nIs/nLD9xItcKJd3m+haoxVBho7FsTDRMjF0=; b=Ui6krop/KxAeEClzF+XCIYkUCleLBXufb8AUcEITBKY/rtwG0FIUY93Knbj7HKOCcBhjEOcVz5XJsn/EDutyEMV8TmLIZWauYD2M1+01c2RLy2wRl8FXcVyvXBMY+zOd5YFUw4HkXOOd1OFKb2vtRaZl57ZI1YhMvod8KfgLverd3gTV/TXA+1ivKIBaCh8ssbc5x/wUchDG36aOlWEwljVnYN0htkftTyhCyUW/mxmNGrbZ82hYUeoSAjx8Nt1MaI+KkBG4n0Zl5TO+3Pm3iBO2w6bRP2hK60Cfc/V5spk6qrVgXOqfu4BciRzDjblvJQk8pB2Hx6bNBH0AbuuVcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/0glP/0nIs/nLD9xItcKJd3m+haoxVBho7FsTDRMjF0=; b=cKsTgaJCQSbx8ka+wwz31EVnmALefNzq242YDy83bpL0fS+NhquNIbmbX4SyTRvtpu+Y+0T4o8LPsEQ//IXealcppCdwPTQInDxMrZgNA0vxq0ZdvChBbSs7LbIeV83uEmie96oambHWcF4KAK4zqz+zK6fDgWevNa8e8682uUM= Received: from MW4PR04CA0235.namprd04.prod.outlook.com (2603:10b6:303:87::30) by MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 26 Sep 2022 10:14:07 +0000 Received: from CO1NAM11FT089.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::5f) by MW4PR04CA0235.outlook.office365.com (2603:10b6:303:87::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 10:14:07 +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 CO1NAM11FT089.mail.protection.outlook.com (10.13.175.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 10:14: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; Mon, 26 Sep 2022 05:14:01 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v5 1/4] dt-bindings: misc: tmr-manager: Add device-tree binding for TMR Manager Date: Mon, 26 Sep 2022 15:43:43 +0530 Message-ID: <20220926101346.272720-2-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926101346.272720-1-appana.durga.kedareswara.rao@amd.com> References: <20220926101346.272720-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: CO1NAM11FT089:EE_|MW4PR12MB6873:EE_ X-MS-Office365-Filtering-Correlation-Id: 59fa44f7-1141-457a-ec89-08da9fa7d8ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2fDpiT6Bx7NkOZfihE8AY5Y5P/7yOnTZPq6OroEKPsMJPCWcc5X6JjiBQXm2t6VWXIX9UJkrZEXZh2Y/K3lySqSWowncHRUVUXchb0kcIr+NZeO+yb3o6k1Cwz0FHykSI9FXDLSaOlRKV2XCLm4QL8+O2LtlILP3avKsGKqWuNBHRwxUh6V73VHQigke/cXMbH1Zhi8kf3zuVAaSq5gBJvKaX1sLSlWSSqlyg2OjIRlWNBDqFi/yH4vtJJdcIuiu4hJx9pKYZj4r0yOcBlko0wmBbLcLbwZMvDVmYPg3bhwuacV64540tUj3SU3exdFNY/j0FNAN/Uw1JVf+7b16isTHVROI4/oGIHZVLWijkAV0hKZizbN+N/BUQKzYwLr/4q4aHqaGBGIdMJsHa7kTS+IR3Z+GC0lyWaIb1Tr01Wai2OXz9J3XxhHE7otHBmwX4PydVP7g5cMVTqWhIt5Md9kiHXxKMYcHi7XQU9k+pPXsbKSK9mah1DSRe1rjzilAwHMINbsGtWX8QP48kIhzlhbU2lLqeIRYBG/4iHpMqkWMFpaAC7FUWNYG87B98ilsYYzJMcXuMIUhvXjnD+v3ZpUtT9y1DUMFOChHBDFnR7taW89uQPw/4riH21LkO5N96cbZ4H2mjGmnQWtF6Q4YCAsr+7veemOT6osbEF8Xttnz3PzJo6IjBC1gS8ASAaQ7tdLT3UpkEKAejPd3jniqQsBHdw+CbMoIkKi3BynYjMEzMYErwA9TLkCukfIPunB7Itee/bB5IXLtdEb/zfrWCr8X/QVFR8xe7R5l0BH7oGIC6iTVnxz4DqHSp/04rZrKC6beFcgCUKmo98ZLDqrgVN69jJnKX6mARnZcZnhM4I3TVXMbIX7uqAPwHtw0iT366/Gnwe5tT0rQD94LaycK3w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199015)(36840700001)(46966006)(40470700004)(1076003)(5660300002)(186003)(81166007)(40460700003)(26005)(40480700001)(36860700001)(6666004)(110136005)(8936002)(2906002)(103116003)(336012)(16526019)(47076005)(86362001)(426003)(36756003)(82310400005)(82740400003)(54906003)(316002)(966005)(83380400001)(356005)(921005)(41300700001)(70206006)(70586007)(2616005)(8676002)(4326008)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 10:14:06.8799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 59fa44f7-1141-457a-ec89-08da9fa7d8ba 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: CO1NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_031420_450293_4A19B393 X-CRM114-Status: GOOD ( 14.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Triple Modular Redundancy(TMR) subsystem contains three microblaze cores, subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. TMR Manager is responsible for performing recovery of the subsystem detects the fault via a break signal it invokes microblaze software break handler which calls the tmr manager driver api to update the error count and status. Signed-off-by: Appana Durga Kedareswara rao Reviewed-by: Krzysztof Kozlowski --- Changes for v5: --> None. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal. .../bindings/misc/xlnx,tmr-manager.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml diff --git a/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml b/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml new file mode 100644 index 000000000000..27de12147a52 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/xlnx,tmr-manager.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Triple Modular Redundancy(TMR) Manager IP + +maintainers: + - Appana Durga Kedareswara rao + +description: | + The Triple Modular Redundancy(TMR) Manager is responsible for handling the + TMR subsystem state, including fault detection and error recovery. The core + is triplicated in each of the sub-blocks in the TMR subsystem, and provides + majority voting of its internal state. + +properties: + compatible: + enum: + - xlnx,tmr-manager-1.0 + + reg: + maxItems: 1 + + xlnx,magic1: + minimum: 0 + maximum: 255 + description: + Magic byte 1, When configured it allows the controller to perform + recovery. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - xlnx,magic1 + +additionalProperties: false + +examples: + - | + tmr-manager@44a10000 { + compatible = "xlnx,tmr-manager-1.0"; + reg = <0x44a10000 0x10000>; + xlnx,magic1 = <0x46>; + }; From patchwork Mon Sep 26 10:13: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: 12988548 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 22658C32771 for ; Mon, 26 Sep 2022 10:17: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=loCXpz309uiB/IzJzESl64DBoEqgFXk0XfARKtlnLs0=; b=c88SHGl0a9MsXp Rwc7cAVNOHTx37jzqgRYyjpE+htFLeg7luN+RS9YLPO+pqfKSh6y75tuoKrOjcNwx95ji1EN+s/Fk bgfU3RLPDsVYN9wlIlYYf9LhJJb0Nl74Rb+MEkTcXfL8KeRfASJ3gNtsfudvbT25cv/puogWVMp+3 FAzMFZ2r0h9s/WcAnyAD9RhrTcJQnGnQalG1C3+TK7MIdsEfqVjAFhdlFW8XSn1rj1kp7tOrmv25R b0BRymXWgD+bcU1iuXvY5rOX3NzmxTFWhdoF2/LjONtNQsT884Frt2qgYbmIQSzUjtVZF2RQGTPKR f6g6OXmCf5wVN+ENj83g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl9S-0040lp-CZ; Mon, 26 Sep 2022 10:15:51 +0000 Received: from mail-mw2nam12on2065.outbound.protection.outlook.com ([40.107.244.65] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl8L-0040EK-9P for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 10:14:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RXeUqfCs8tF9pdwp//PM6TAXomuIhdDUh5h5ud+MY/d59Np23Z1w5HsIB7DCvu25qQRhNlwkaw6K6IpgYV6pnx6yidv2/bG4zRQQjlrQnI52b+DaqH6f2uggsXG3isw0REGvRoDegGLHFNYSCwHUrsx2/6bhRas+EvFyi/085jBM9JWMHTfgAkhfosB+KT7B23Xv/XoYf1S4CAjmenR6MIJqcM2TFMAv9OWxILpDj8SMCzdXzmBICYNKzaL7IUsC0yjVwC31wQpn+UQcs0B/y5KF+HKKgnv3wnGJpkWvhdQyRfNHJ5zbmXhm/bheP4yr6ewM5vU/dYc7DhCFLAzd8A== 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=Kvt87oq11lQD0jq4J3fc0Dfx6QWL4oqI9NQM/zoD/tE=; b=i9oWn900W/enAMR+JVkyPca5VC8qV8z33JA9ZzfSehhAui1NfyaFLNYXepMt+pW0Zl8MhXchNnL/mf93e2P0XPaYUcZgTJKfIH56s0L2Bsf0MGUKC7OcMv+Dnpt40RLqBZ80Czyh8X/4LZWZ7QVDvoVC/tmkkWPqp3l68JHG05iTQmbb15DyNnCNw+tH/C6KWqIODKAewj5oSx7pfxUvo/0ZN8bwp/BGPKb88xN/TpcnihMmAXQCVwUvkPCC/Q2gcrubJ6v956Nlu0DJhhVKsBLs3o05UGXYqv5wGF0lvOxmnb2AHponZTdOp4cEogN5vDvcWKsjt0/3f52xl3EK8g== 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=Kvt87oq11lQD0jq4J3fc0Dfx6QWL4oqI9NQM/zoD/tE=; b=QsnlUiG1a6VRDbCaN6qD5GVaanWXFKPSciBPQsMohbaKwy8a+2MPbXUKzS9E62bCBYcx5ZZZvwFTvP2t1n7qxLTxU5eeVO2jy2uSWXuytLnMfAK2Uc72xQ9vG/NBmU7hhr77y1y7jzY+rGKjOruSbrb0UWtwijdk3j10AajQo9I= Received: from MW3PR05CA0009.namprd05.prod.outlook.com (2603:10b6:303:2b::14) by BL1PR12MB5971.namprd12.prod.outlook.com (2603:10b6:208:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 26 Sep 2022 10:14:34 +0000 Received: from CO1NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::aa) by MW3PR05CA0009.outlook.office365.com (2603:10b6:303:2b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9 via Frontend Transport; Mon, 26 Sep 2022 10:14: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 CO1NAM11FT047.mail.protection.outlook.com (10.13.174.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 10:14:33 +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; Mon, 26 Sep 2022 05:14:05 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , kernel test robot Subject: [PATCH v5 2/4] drivers: misc: Add Support for TMR Manager Date: Mon, 26 Sep 2022 15:43:44 +0530 Message-ID: <20220926101346.272720-3-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926101346.272720-1-appana.durga.kedareswara.rao@amd.com> References: <20220926101346.272720-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: CO1NAM11FT047:EE_|BL1PR12MB5971:EE_ X-MS-Office365-Filtering-Correlation-Id: 013d5e7e-f4cb-4c3c-df07-08da9fa7e86f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4V3psZ+y/LwjC7NvQ8ScmOlUm+YCXaEJjggNQavnxZpmpbTiKWo7BbMvNBNlwvY2dT+N68dTTT79lWG/IfSA2sgOI74IUUBQuyl+8JLcdBxKUE7Ui2Nz6oOY0s3Ee5IGxMCLj2BNY9E/5DzBWDbOJWjU/lKRpkZXVCsvAxUYpYGORWppqo02tTmoy1wd9srTdFcCStbpceYsXfL2SjMuIR/d/3kGtOKUE2VMqf6aks/xmm+uNr3ElsIkeFHNtDXkLDL8HuQT7iSc0vXTXcpzgDI7R4hCFs5CxOBSw/vmY5RJ+DPXfKzSo0rh6kHpzPyGnF8HgH/9p/L3p7sQejNrMj2D23g9VGC/EF8NjJQxo3+MyGx5ZiQemrPdSIGwXUz0wWFQTMDexZJeX3nqC/7Ypxy/EtB2D/6dRYEiHWF0AhNxtp1pamjdHLoLv+vUSnnHEYMwUah3idK4dm0K6AM71fFmElpBCGtk8Mk6mund7QP5mHBm6UcsjvBNyae5rp1royaafDOulMkhgSFQLOOqpibO0eXqyDjTqYQQ0MmUNJ4+FwR7aWvvLIFxGK3JZQjr9iSv1mRA5AHOo6qAPzeuR/0Qv4JU4YSRwTT0Tl2A5wvKrkDyee0Dzs4IbA2pIQXhObTtB5he+yXNT8ddcKXQe0hBmwmTro9uYUzaghKCghRhG6tV3hrXkGK93U3ZKCa8ENyRX/Gq5NHQfAhhblR3q51DNRy+i7GQCPxq+Jpn1qHRejyuENctF/NKKqTa0HwUGIWwkmST7mUvtgmLqGhYQNjU9XmxVoEfGh6xT7hd64sZwYO2n6eMEmGF5XXO+/nFBBLFY719+F1al0GJx2BO+b20+nBuGVxjtOIlB4olhJ8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199015)(36840700001)(46966006)(40470700004)(478600001)(5660300002)(8936002)(36756003)(966005)(26005)(82740400003)(6666004)(30864003)(82310400005)(41300700001)(83380400001)(70586007)(70206006)(8676002)(4326008)(47076005)(426003)(316002)(81166007)(2616005)(40460700003)(103116003)(54906003)(16526019)(40480700001)(1076003)(186003)(110136005)(336012)(356005)(921005)(86362001)(36860700001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 10:14:33.2315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 013d5e7e-f4cb-4c3c-df07-08da9fa7e86f 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: CO1NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5971 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_031441_433565_375AFAFF X-CRM114-Status: GOOD ( 24.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Triple Modular Redundancy(TMR) subsystem contains three microblaze cores, subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. TMR Manager is responsible for performing recovery of the subsystem detects the fault via a break signal it invokes microblaze software break handler which calls the tmr manager driver api to update the error count and status, added support for fault detection feature via sysfs interface. Usage: To know the break handler count(Error count): cat /sys/devices/platform/amba_pl/44a10000.tmr_manager/errcnt Signed-off-by: Appana Durga Kedareswara rao Reported-by: kernel test robot --- Changes for v5: --> Fixed Unexpected indentation htmldoc warning in sysfs-driver-xilinx-tmr-manager. --> Removed sysfs references from the Kconfig description. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal. .../testing/sysfs-driver-xilinx-tmr-manager | 16 ++ MAINTAINERS | 7 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 3 +- drivers/misc/xilinx_tmr_manager.c | 220 ++++++++++++++++++ 5 files changed, 255 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..eeca5926eec4 --- /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 f5ca4aefd184..15805b4e314f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13278,6 +13278,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..ddb56ea1ed62 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -496,6 +496,16 @@ config VCPU_STALL_DETECTOR If you do not intend to run this kernel as a guest, say N. +config TMR_MANAGER + tristate "Select TMR Manager" + depends on MICROBLAZE && MB_MANAGER + help + This option enables the driver developed for TMR Manager. + The Triple Modular Redundancy(TMR) manager provides support for + fault detection. + + Say N here unless you know what you are doing. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 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..535f723c1a5a --- /dev/null +++ b/drivers/misc/xilinx_tmr_manager.c @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx TMR Subsystem. + * + * Copyright (C) 2022 Xilinx, Inc. + * + * Description: + * This driver is developed for TMR Manager,The Triple Modular Redundancy(TMR) + * Manager is responsible for handling the TMR subsystem state, including + * fault detection and error recovery. The core is triplicated in each of + * the sub-blocks in the TMR subsystem, and provides majority voting of + * its internal state provides soft error detection, correction and + * recovery. + */ + +#include +#include +#include + +/* TMR Manager Register offsets */ +#define XTMR_MANAGER_CR_OFFSET 0x0 +#define XTMR_MANAGER_FFR_OFFSET 0x4 +#define XTMR_MANAGER_CMR0_OFFSET 0x8 +#define XTMR_MANAGER_CMR1_OFFSET 0xC +#define XTMR_MANAGER_BDIR_OFFSET 0x10 +#define XTMR_MANAGER_SEMIMR_OFFSET 0x1C + +/* Register Bitmasks/shifts */ +#define XTMR_MANAGER_CR_MAGIC1_MASK GENMASK(7, 0) +#define XTMR_MANAGER_CR_MAGIC2_MASK GENMASK(15, 8) +#define XTMR_MANAGER_CR_RIR_MASK BIT(16) +#define XTMR_MANAGER_FFR_LM12_MASK BIT(0) +#define XTMR_MANAGER_FFR_LM13_MASK BIT(1) +#define XTMR_MANAGER_FFR_LM23_MASK BIT(2) + +#define XTMR_MANAGER_CR_MAGIC2_SHIFT 4 +#define XTMR_MANAGER_CR_RIR_SHIFT 16 +#define XTMR_MANAGER_CR_BB_SHIFT 18 + +#define XTMR_MANAGER_MAGIC1_MAX_VAL 255 + +/** + * struct xtmr_manager_dev - Driver data for TMR Manager + * @regs: device physical base address + * @cr_val: control register value + * @magic1: Magic 1 hardware configuration value + * @err_cnt: error statistics count + * @phys_baseaddr: Physical base address + */ +struct xtmr_manager_dev { + void __iomem *regs; + u32 cr_val; + u32 magic1; + u32 err_cnt; + resource_size_t phys_baseaddr; +}; + +/* IO accessors */ +static inline void xtmr_manager_write(struct xtmr_manager_dev *xtmr_manager, + u32 addr, u32 value) +{ + iowrite32(value, xtmr_manager->regs + addr); +} + +static inline u32 xtmr_manager_read(struct xtmr_manager_dev *xtmr_manager, + u32 addr) +{ + return ioread32(xtmr_manager->regs + addr); +} + +static void xmb_manager_reset_handler(struct xtmr_manager_dev *xtmr_manager) +{ + /* Clear the FFR Register contents as a part of recovery process. */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_FFR_OFFSET, 0); +} + +static void xmb_manager_update_errcnt(struct xtmr_manager_dev *xtmr_manager) +{ + xtmr_manager->err_cnt++; +} + +static ssize_t errcnt_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); + + return sysfs_emit(buf, "%x\n", xtmr_manager->err_cnt); +} +static DEVICE_ATTR_RO(errcnt); + +static ssize_t dis_block_break_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t size) +{ + struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); + int ret; + long value; + + ret = kstrtoul(buf, 16, &value); + if (ret) + return ret; + + /* unblock the break signal*/ + xtmr_manager->cr_val &= ~(1 << XTMR_MANAGER_CR_BB_SHIFT); + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, + xtmr_manager->cr_val); + return size; +} +static DEVICE_ATTR_WO(dis_block_break); + +static struct attribute *xtmr_manager_dev_attrs[] = { + &dev_attr_dis_block_break.attr, + &dev_attr_errcnt.attr, + NULL, +}; +ATTRIBUTE_GROUPS(xtmr_manager_dev); + +static void xtmr_manager_init(struct xtmr_manager_dev *xtmr_manager) +{ + /* Clear the SEM interrupt mask register to disable the interrupt */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_SEMIMR_OFFSET, 0); + + /* Allow recovery reset by default */ + xtmr_manager->cr_val = (1 << XTMR_MANAGER_CR_RIR_SHIFT) | + xtmr_manager->magic1; + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, + xtmr_manager->cr_val); + /* + * Configure Break Delay Initialization Register to zero so that + * break occurs immediately + */ + xtmr_manager_write(xtmr_manager, XTMR_MANAGER_BDIR_OFFSET, 0); + + /* + * To come out of break handler need to block the break signal + * in the tmr manager, update the xtmr_manager cr_val for the same + */ + xtmr_manager->cr_val |= (1 << XTMR_MANAGER_CR_BB_SHIFT); + + /* + * When the break vector gets asserted because of error injection, + * the break signal must be blocked before exiting from the + * break handler, Below api updates the TMR manager address and + * control register and error counter callback arguments, + * which will be used by the break handler to block the + * break and call the callback function. + */ + xmb_manager_register(xtmr_manager->phys_baseaddr, xtmr_manager->cr_val, + (void *)xmb_manager_update_errcnt, + xtmr_manager, (void *)xmb_manager_reset_handler); +} + +/** + * xtmr_manager_probe - Driver probe function + * @pdev: Pointer to the platform_device structure + * + * This is the driver probe routine. It does all the memory + * allocation for the device. + * + * Return: 0 on success and failure value on error + */ +static int xtmr_manager_probe(struct platform_device *pdev) +{ + struct xtmr_manager_dev *xtmr_manager; + struct resource *res; + int err; + + xtmr_manager = devm_kzalloc(&pdev->dev, sizeof(*xtmr_manager), + GFP_KERNEL); + if (!xtmr_manager) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + xtmr_manager->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(xtmr_manager->regs)) + return PTR_ERR(xtmr_manager->regs); + + xtmr_manager->phys_baseaddr = res->start; + + err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic1", + &xtmr_manager->magic1); + if (err < 0) { + dev_err(&pdev->dev, "unable to read xlnx,magic1 property"); + return err; + } + + if (xtmr_manager->magic1 > XTMR_MANAGER_MAGIC1_MAX_VAL) { + dev_err(&pdev->dev, "invalid xlnx,magic1 property value"); + return -EINVAL; + } + + /* Initialize TMR Manager */ + xtmr_manager_init(xtmr_manager); + + platform_set_drvdata(pdev, xtmr_manager); + + return 0; +} + +static const struct of_device_id xtmr_manager_of_match[] = { + { + .compatible = "xlnx,tmr-manager-1.0", + }, + { /* end of table */ } +}; +MODULE_DEVICE_TABLE(of, xtmr_manager_of_match); + +static struct platform_driver xtmr_manager_driver = { + .driver = { + .name = "xilinx-tmr_manager", + .of_match_table = xtmr_manager_of_match, + .dev_groups = xtmr_manager_dev_groups, + }, + .probe = xtmr_manager_probe, +}; +module_platform_driver(xtmr_manager_driver); + +MODULE_AUTHOR("Xilinx, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Manager Driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Sep 26 10:13:45 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: 12988550 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 39FEAC07E9D for ; Mon, 26 Sep 2022 10:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X4nEIpvuXQa2APFQK8xtzceznn6OeI4mVSENt51cgg8=; b=hOeTT8Eoi+M9ju 4WkS9hT4wTvb1GzlswUjTRNirzP3OIb8voJqdNjGqO+Zhe/MLTl52Cdkq5mnia5cWDq2pAR9jjUS3 2TgCdoIrZeSjRuPhM+zkBZvXM2lVBmurc9UmB4pAjN+O3UZJo3otQDE1xJDzB4+h/7cFdY9s1iY0R xQRlJ96sLH51cZh6qSAhk5uMpsTh05FUBAfojKbDL4PPv6YI5MS3CS8jE1BJoLVvEC8Lm1nGAikzY /+aHABYWb84D3FmcFBCEYMdhQNLX3bkhj5AOTJ37BUrSDjgPJKCABPIPXRvY6+o56WCiTzY+A2yWQ aGNGj9jaEFohK3oJbzbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oclB9-0041XD-PI; Mon, 26 Sep 2022 10:17:36 +0000 Received: from mail-bn8nam12on2053.outbound.protection.outlook.com ([40.107.237.53] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl8N-0040Fy-Ur for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 10:14:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U9PkfzJu7wH6fGCjbK30lzb1BIsFbpKfSm9pD0VmwaGIEbip6rZiFkfNggPWrjFc1B9J3UYntOCtU3DEi9qNmPMcEaGqniwMFv/EDY2cNBuf2aiFng+Z4t3r47MV50TX3OsAUYLJLzrmekziPqpjkMMv9kxdVo++M8JEaV1Wm2FvJQ4WB5h7rshS1+JVAYSHWTKP0XRgvU/WVWgwjbDZMyAqVe9I6iUoSCenrW6vW7Ta1hLAvVF+LHzSW45xa4wyHTLMpRnIwAYZAU/OOjyM7A8jSO5IC8zQPNvlSqREkhUwTsqG/bTcWQWFZfYADAEehPgekuHLX7L0ozOoWp+o5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e5t6qjFmP045OWPl3Ah/l2TYsr2RqiQzpewzkLa/tr0=; b=MRTkDn5UotHMkGXQamFrqYEftgXqfxoNidw0DpX0SFu6va7Ku6jdxmPv4gYyiQwwQPnej8hU2UoXa1UJbYTcJWhjcDcb7qIgYU4OkrasfsRr8w8BrPhkaZU/7REPaV1iBHVPOfgES/txhAIss3VuAE119lZ9KUf/+aJ/OyIXDZiBWsSRaOsjkTvEmR0b7NKadsqEPM4/TM8RSoEePHBU8l3pR+jxM+Ky2yu4L6X5TM5v9A3q3AwVAcBV8D1enIDRK8BMoHB58Pi9D2LcuCkoXl5IbMalsBa+9FLe3qgT7SkRDP4NPQXJ+4slzA4F8H5fpiAcOJw2Ab7tBlWPiVtaoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e5t6qjFmP045OWPl3Ah/l2TYsr2RqiQzpewzkLa/tr0=; b=xOISuVTkj/ebQvADP/G6MhKJ8FT6L4Qw0DtkvrdwfGGbUFEeCy54tFdktMzXZvQmPMcPeU9s2eOKTGeV7kFCgByT1c+yu8GqA3y1lIqEj+0Aa92RQbtbUftDfYpDWT1jTv4mzl0Ibu07u+kKn6LXQHm98V9gnrB0A3etY/38Hfs= Received: from MW3PR05CA0026.namprd05.prod.outlook.com (2603:10b6:303:2b::31) by BY5PR12MB4241.namprd12.prod.outlook.com (2603:10b6:a03:20c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 26 Sep 2022 10:14:38 +0000 Received: from CO1NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::8b) by MW3PR05CA0026.outlook.office365.com (2603:10b6:303:2b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9 via Frontend Transport; Mon, 26 Sep 2022 10:14:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT047.mail.protection.outlook.com (10.13.174.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 10:14:38 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 26 Sep 2022 05:14:32 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , , Krzysztof Kozlowski Subject: [PATCH v5 3/4] dt-bindings: misc: tmr-inject: Add device-tree binding for TMR Inject Date: Mon, 26 Sep 2022 15:43:45 +0530 Message-ID: <20220926101346.272720-4-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926101346.272720-1-appana.durga.kedareswara.rao@amd.com> References: <20220926101346.272720-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: CO1NAM11FT047:EE_|BY5PR12MB4241:EE_ X-MS-Office365-Filtering-Correlation-Id: 731e0be5-9b51-40e8-3b9f-08da9fa7eb80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTa8A/brsehSlmZbQ8UfoxEnLkbzJWW/YZNuZfK5+wpWaaR5dmbV4vKdJ1KbXWm13q698f67mv5aD2JEPyCC32U5ppYdRklOPqz85rEnWWWQX+uSsGr6xv2tzJEjbIvqdAAbN9nBxsAx8nbao5OcH4i04yDMxlgA5vxjmNu85j7SZYnqyLT5MdpPcsiHemPER4Scxr5sRPCpAiDbRyDO1sEDiAqs4oi21VXez4G8hbZnEFXU7RnEP5qJ1w/rtRUKXOXUbMwEOkppL+TNcwxgqOmXGPIdVTQNIGf1c5APKtyRf4zIgIj5hF2cRLZ/T6B31o5ejDgdqYY0H7adkmJ8sCibC8LZ2S4YGdOP3Y4gPR/s0hAANbBdD2d8OShVfYrxE5WNDq7hUOXiejO7RhS8gkPTBjrF57HvWq6Q40yc1sis25AlD4RIccSFC1CIP9vFcfgawDGJjyYsnN9LOi1CM2XD2hltZzUdWs10bNpR3CDiCFKN5d1V5iaG8xPW/6znJ5xqOXnEzlnkkCfJW8ShUYbHITw1joc60iIfoGRqNHhXK5oRLdmGUCAPF2tf/T+THVlSgFR9BdQMu3KkuBby9JgMjHiGFhCaE2ePXTsV2DuWHUeWTLyOGthjbTNjRsCBkIH+qvDERo8hR8ZBOMKk+KrtFL9hTM37QAPa/Teh+C2TosHbwHamJZ+O3q1nGs9suVqzbAVzkQko6jFKfGMh54/rB6M1HjVgIcxxVMNRCj8SLVEuBxBZrhidd9tzUmzZtsRc1w8XDSzp0qRiCitlZeLvp8LFBApVGa8y+gQ+hL5nEwpX1y+yr55tIRf4l8BvBlEj1IpIesiHoiTTQ1ojyxMh4bY27EKGwKwWZA3ibOApA9xVkHSH5NURFAIyYsvoghJT3MbyPuEIMX1xF4WlzQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(346002)(39860400002)(396003)(451199015)(46966006)(40470700004)(36840700001)(16526019)(336012)(54906003)(47076005)(426003)(6666004)(316002)(1076003)(26005)(110136005)(36756003)(70206006)(4326008)(8676002)(186003)(2616005)(2906002)(70586007)(356005)(921005)(5660300002)(103116003)(82740400003)(40460700003)(81166007)(41300700001)(83380400001)(86362001)(40480700001)(8936002)(36860700001)(82310400005)(478600001)(966005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 10:14:38.3719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 731e0be5-9b51-40e8-3b9f-08da9fa7eb80 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: CO1NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4241 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_031444_035505_17C7CF96 X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Triple Modular Redundancy(TMR) Inject core provides functional fault injection by changing selected MicroBlaze instructions, which provides the possibility to verify that the TMR subsystem error detection and fault recovery logic is working properly. Signed-off-by: Appana Durga Kedareswara rao Reviewed-by: Krzysztof Kozlowski --- Changes for v5: --> None. Changes for v4: --> None. Changes for v3: --> Added Krzysztof Reviewed by. Changes for v2: --> Added minimum and maximum values for xlnx,magic1 property as suggested by Michal. --> Fixed 80 char limit in description as suggested by Michal .../bindings/misc/xlnx,tmr-inject.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml diff --git a/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml b/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml new file mode 100644 index 000000000000..1b6020e4ec27 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/xlnx,tmr-inject.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Triple Modular Redundancy(TMR) Inject IP + +maintainers: + - Appana Durga Kedareswara rao + +description: | + The Triple Modular Redundancy(TMR) Inject core provides functional fault + injection by changing selected MicroBlaze instructions, which provides the + possibility to verify that the TMR subsystem error detection and fault + recovery logic is working properly. + +properties: + compatible: + enum: + - xlnx,tmr-inject-1.0 + + reg: + maxItems: 1 + + xlnx,magic: + minimum: 0 + maximum: 255 + description: | + Magic number, When configured it allows the controller to perform + recovery. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - xlnx,magic + +additionalProperties: false + +examples: + - | + fault-inject@44a30000 { + compatible = "xlnx,tmr-inject-1.0"; + reg = <0x44a10000 0x10000>; + xlnx,magic = <0x46>; + }; From patchwork Mon Sep 26 10:13:46 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: 12988549 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 D9C05C32771 for ; Mon, 26 Sep 2022 10:18:01 +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=HVf7SbxWJTSvCalmE8Mi0bUnHoJghOUydYK44JhnnMc=; b=pWiDx4YUytecNe IsgX2FJ8G0obxJTL3VRPVi2NcBAyOGl9muHelp8OcrbzMcdbXfSPpF7EGfy3HReSaOmPPzgSY1qFo 57WPIwwQd/Mst1yyXqM8qS/h7IwJ09x5YTx9cDUZFjeSd19fVEEQ4+j4dSYHabbL4VBtxQtRIxJ4n C9kaM8D1yyefIMbM+seJbrLQwS3MET0QfWM4M3xnjx/gz+QNQw5pU/NP54CJ/bfGZKx/2OvQUpQxT MRxusxh8eZIYh2mmwXLBaC6CzwQzMMwOHMKRJiIsa07GFXCh6cbzFFRx4geqmWoTupykhMgzGR5SY pIv0Xpwq3R1me/TreFZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oclAD-00418p-Jw; Mon, 26 Sep 2022 10:16:37 +0000 Received: from mail-bn8nam04on2065.outbound.protection.outlook.com ([40.107.100.65] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocl8O-0040G9-Lw for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 10:14:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iNeakxRdwZYJVEFv8pVLZo9KXDWBF9HIb6Fa9CD9Vpk3zzkElwjX5iqy/e1GRMeu7LCJUG57lHIiK1KvkkjCVhW0960zhDIR1OscYy1uoiTcWxLsgC9LdFAxgUbzT4Rpo7LuGWXpjAi21VD39IM1ru2pTXhotGtW/SD3nZX1JS2lXHlfLcVZXGBXFPHd4VY5YdyjBEqevtlG30uooIeY2No6Z8gZevJdE5yJKiPnoYJYnzoTr8X/izuW6v+mSSQioInPsIVyjinwETK3O5oXgxsw1eMK79B3ag9RLG77WCo8Lg4V/JgXzS+PaTgBnbiTUfJ9Ar0lFLozwneqdODPmw== 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=GYHWkPSZ5IN+6qLbfrU9mwPjFur2Go5G6maTwL796to=; b=AwLv2CtjFp/qImpp1x47Pa1vvQnUaOjJbXwrchwfjunb5OPlUs5OuJZAOOw70P69Ms+dAJkdIY0/oBPl2SuUZF5Mbs/neAxBkBtfGdt5tC8l4CZk4Jnxeim7zJfybApiTsG78cMDotmyLIPcgkVpSJWz5Q82VPlRB4eJqy59++WS7dmv792flhjB2zjBpPqENwpCGNncuLa08Glwz7B2mwkCl/SgkuDgdBzutQpGu/NjFReVjkSQF6f6gO29PxB+rk0aDD17Hd9pD1Q9i9OjKAzwdiYFcDGpU4twGUK5w0g+3JSiKy/wlrHY9qQycodwkSvl7CvAj9LzWbjePKP/hw== 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=GYHWkPSZ5IN+6qLbfrU9mwPjFur2Go5G6maTwL796to=; b=QtZD1pBARC5pzrgYZ2DewC6S8qOsdxUealbcVsNFzmKmAp11bFAFWUBHJIXJak2yqNKqohEy9OztFKIB9H36wpmbxT2bRTgNe8R0HHPUELLAB8NBojyAyAWH0DgUKKmetXW83uQnDzvuATEbg85f9JSygrZ94Dd7wE80VozwDao= Received: from MW4PR03CA0285.namprd03.prod.outlook.com (2603:10b6:303:b5::20) by DS0PR12MB6463.namprd12.prod.outlook.com (2603:10b6:8:c5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 26 Sep 2022 10:14:40 +0000 Received: from CO1NAM11FT104.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::bf) by MW4PR03CA0285.outlook.office365.com (2603:10b6:303:b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 10:14:39 +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 CO1NAM11FT104.mail.protection.outlook.com (10.13.174.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 10:14:39 +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; Mon, 26 Sep 2022 05:14:36 -0500 From: Appana Durga Kedareswara rao To: , , , , , , , , , , CC: , Subject: [PATCH v5 4/4] drivers: misc: Add Support for TMR Inject IP Date: Mon, 26 Sep 2022 15:43:46 +0530 Message-ID: <20220926101346.272720-5-appana.durga.kedareswara.rao@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926101346.272720-1-appana.durga.kedareswara.rao@amd.com> References: <20220926101346.272720-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: CO1NAM11FT104:EE_|DS0PR12MB6463:EE_ X-MS-Office365-Filtering-Correlation-Id: ad290e53-32f0-48ec-1455-08da9fa7ec15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s4FZPCPT7XMTurhncUKEe3sokPEHOWr4TeH/t4JJ3Vrz9Co52t+e/r8bZfOdezZpSc1wJ3XunmlSmmDF4IBTgkWyUpSBioXLZK/gibtWViQaZPmo6RG/+gDo77v5aNmyAIcllbcR02k3qZGBQEX6y1tSa2OlPpynagXTKsNZFblZ3kc6HxRHauSRYCp1TvSh9ejuurqagW1QRlOfIZzGqMJJ5OZ0d8lK/L+J/kREgJA8gOiuS8A0yDQpThy5iGRsYJKbPrAl+rAq1KE44YNyrIuPtc1c0KDJBM7j8U/hG94EDSPkTSw9tlvjVO498Xct3v7WJETKaCInFy4wJ/rgrqDzfyDW+JBEzp4L0CWDdZQ4IfDct1KqsbYflrZvr2hV+O+m3E1goJgFaJQxNS7IocX8XnjCCh/r/SodcoMCeVEbuLGRIYAWVyRRvU2kMT/jdVVxKmdnJHlHr8Sb6R1qLo41xmfRIKcCQAZEW5T1kCglfS9cD03pv1fuZxRehcrGxew2mCSKdXHQsKf2Rso0hngkTUS5w1gWNZZNJ9+LAzDV/jnLUl8caomzwfw5W5il0NAQmNNvsnajUxRJ7rACrh/pAw4PeVmR4FgI0ZqDn3nSZp86tuJ9qhVPoK/DynaH2s/QJi+OwWX6VqmDTrr/LroGAnruS7zvVAAf0DK7no8urbxG50E26Hlpr4RaJAyl7aY2bG+TfPitkg/g0W8BPQmbpVZU/RMXJ2pI2a83hcqsIWn2Ufm+gBWP8ybyYK1vTSa8KM9LRVIY5vHov9WNvWjTvtBbfZBlJAYsbJqEv9GXNcTJzmDPTh44c4wj4Be4 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199015)(46966006)(40470700004)(36840700001)(316002)(86362001)(356005)(36756003)(336012)(8936002)(2906002)(81166007)(54906003)(921005)(40460700003)(83380400001)(16526019)(186003)(103116003)(1076003)(2616005)(40480700001)(110136005)(426003)(5660300002)(36860700001)(6666004)(478600001)(41300700001)(26005)(70586007)(70206006)(8676002)(4326008)(82310400005)(82740400003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 10:14:39.3474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad290e53-32f0-48ec-1455-08da9fa7ec15 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: CO1NAM11FT104.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6463 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_031444_845985_E24DB253 X-CRM114-Status: GOOD ( 29.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Triple Modular Redundancy(TMR) provides functional fault injection by changing selected MicroBlaze instructions, which provides the possibility to verify that the TMR subsystem error detection and fault recovery logic is working properly. Usage: echo 1 > /sys/kernel/debug/xtmr_inject/inject_fault/inject_fault Signed-off-by: Appana Durga Kedareswara rao --- Changes for v5: --> None. Changes for v4: --> Update depends on with FAULT_INJECTION_DEBUG_FS instead of FAULT_INJECTION. Changes for v3: --> Updated the driver to use fault-injection api as suggested by Greg. --> Updated the Kconfig to compile the driver as a module. Changes for v2: --> Fixed Month in the sysfs description. --> Fixed line over 80 char in driver. --> Replaced kstrtol with kstrtoul as suggested by Michal. --> Added error check for xlnx,magic value. MAINTAINERS | 6 ++ drivers/misc/Kconfig | 10 ++ drivers/misc/Makefile | 1 + drivers/misc/xilinx_tmr_inject.c | 171 +++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 drivers/misc/xilinx_tmr_inject.c diff --git a/MAINTAINERS b/MAINTAINERS index 15805b4e314f..341d4fcd38b4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13285,6 +13285,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 ddb56ea1ed62..6422c43eebe1 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..d4db15b8899d --- /dev/null +++ b/drivers/misc/xilinx_tmr_inject.c @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Driver for Xilinx TMR Inject IP. + * + * Copyright (C) 2022 Xilinx, Inc. + * + * Description: + * This driver is developed for TMR Inject IP,The Triple Modular Redundancy(TMR) + * Inject provides fault injection. + */ + +#include +#include +#include +#include + +/* TMR Inject Register offsets */ +#define XTMR_INJECT_CR_OFFSET 0x0 +#define XTMR_INJECT_AIR_OFFSET 0x4 +#define XTMR_INJECT_IIR_OFFSET 0xC +#define XTMR_INJECT_EAIR_OFFSET 0x10 +#define XTMR_INJECT_ERR_OFFSET 0x204 + +/* Register Bitmasks/shifts */ +#define XTMR_INJECT_CR_CPUID_SHIFT 8 +#define XTMR_INJECT_CR_IE_SHIFT 10 +#define XTMR_INJECT_IIR_ADDR_MASK GENMASK(31, 16) + +#define XTMR_INJECT_MAGIC_MAX_VAL 255 + +/** + * struct xtmr_inject_dev - Driver data for TMR Inject + * @regs: device physical base address + * @magic: Magic hardware configuration value + */ +struct xtmr_inject_dev { + void __iomem *regs; + u32 magic; +}; + +static DECLARE_FAULT_ATTR(inject_fault); +static char *inject_request; +module_param(inject_request, charp, 0); +MODULE_PARM_DESC(inject_request, "default fault injection attributes"); +static struct dentry *dbgfs_root; + +/* IO accessors */ +static inline void xtmr_inject_write(struct xtmr_inject_dev *xtmr_inject, + u32 addr, u32 value) +{ + iowrite32(value, xtmr_inject->regs + addr); +} + +static inline u32 xtmr_inject_read(struct xtmr_inject_dev *xtmr_inject, + u32 addr) +{ + return ioread32(xtmr_inject->regs + addr); +} + +static int xtmr_inject_set(void *data, u64 val) +{ + if (val != 1) + return -EINVAL; + + xmb_inject_err(); + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(xtmr_inject_fops, NULL, xtmr_inject_set, "%llu\n"); + +void xtmr_init_debugfs(struct xtmr_inject_dev *xtmr_inject) +{ + struct dentry *dir; + + dbgfs_root = debugfs_create_dir("xtmr_inject", NULL); + dir = fault_create_debugfs_attr("inject_fault", dbgfs_root, + &inject_fault); + debugfs_create_file("inject_fault", 0200, dir, NULL, + &xtmr_inject_fops); +} + +static void xtmr_inject_init(struct xtmr_inject_dev *xtmr_inject) +{ + u32 cr_val; + + if (inject_request) + setup_fault_attr(&inject_fault, inject_request); + /* Allow fault injection */ + cr_val = xtmr_inject->magic | + (1 << XTMR_INJECT_CR_IE_SHIFT) | + (1 << XTMR_INJECT_CR_CPUID_SHIFT); + xtmr_inject_write(xtmr_inject, XTMR_INJECT_CR_OFFSET, + cr_val); + /* Initialize the address inject and instruction inject registers */ + xtmr_inject_write(xtmr_inject, XTMR_INJECT_AIR_OFFSET, + XMB_INJECT_ERR_OFFSET); + xtmr_inject_write(xtmr_inject, XTMR_INJECT_IIR_OFFSET, + XMB_INJECT_ERR_OFFSET & XTMR_INJECT_IIR_ADDR_MASK); +} + +/** + * xtmr_inject_probe - Driver probe function + * @pdev: Pointer to the platform_device structure + * + * This is the driver probe routine. It does all the memory + * allocation for the device. + * + * Return: 0 on success and failure value on error + */ +static int xtmr_inject_probe(struct platform_device *pdev) +{ + struct xtmr_inject_dev *xtmr_inject; + int err; + + xtmr_inject = devm_kzalloc(&pdev->dev, sizeof(*xtmr_inject), + GFP_KERNEL); + if (!xtmr_inject) + return -ENOMEM; + + xtmr_inject->regs = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(xtmr_inject->regs)) + return PTR_ERR(xtmr_inject->regs); + + err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic", + &xtmr_inject->magic); + if (err < 0) { + dev_err(&pdev->dev, "unable to read xlnx,magic property"); + return err; + } + + if (xtmr_inject->magic > XTMR_INJECT_MAGIC_MAX_VAL) { + dev_err(&pdev->dev, "invalid xlnx,magic property value"); + return -EINVAL; + } + + /* Initialize TMR Inject */ + xtmr_inject_init(xtmr_inject); + + xtmr_init_debugfs(xtmr_inject); + + platform_set_drvdata(pdev, xtmr_inject); + + return 0; +} + +static int xtmr_inject_remove(struct platform_device *pdev) +{ + debugfs_remove_recursive(dbgfs_root); + dbgfs_root = NULL; + return 0; +} + +static const struct of_device_id xtmr_inject_of_match[] = { + { + .compatible = "xlnx,tmr-inject-1.0", + }, + { /* end of table */ } +}; +MODULE_DEVICE_TABLE(of, xtmr_inject_of_match); + +static struct platform_driver xtmr_inject_driver = { + .driver = { + .name = "xilinx-tmr_inject", + .of_match_table = xtmr_inject_of_match, + }, + .probe = xtmr_inject_probe, + .remove = xtmr_inject_remove, +}; +module_platform_driver(xtmr_inject_driver); +MODULE_AUTHOR("Xilinx, Inc"); +MODULE_DESCRIPTION("Xilinx TMR Inject Driver"); +MODULE_LICENSE("GPL");