From patchwork Tue Dec 19 05:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 180763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1734896dyi; Mon, 18 Dec 2023 21:51:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEog6s0y7WFJIJ/6wrQdhSLWLflLdmOsY9gqZqa9k5LNPkP3HpPPl1sqraIi5WF8ljmOs1j X-Received: by 2002:a17:90b:1d02:b0:28b:3bb9:ddf6 with SMTP id on2-20020a17090b1d0200b0028b3bb9ddf6mr3106404pjb.88.1702965104601; Mon, 18 Dec 2023 21:51:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702965104; cv=pass; d=google.com; s=arc-20160816; b=uiPg6Exo7WpNn/ZSpa7F8YG1MNOmVfxBtS5xrBmEE5KDsl0JSlHhaM2ointUHteimU LcXk3DZNaHVrUX9DrocXY0efEan8IKkoIv13t0ZgTqEFXZvbG8gzpODIqiHNAJSGHheU Cu8Xb7UpRL0+T2HpSVy0uDzeibevav+7mJ9fGB/mmxuIu/dLodXp/RNw+yWY/E4xPsvG ezllkkZ9hF0fqmlaSnn1ARnD41JGUQSVb9v5SOLyjyQex7BSSvPDedxsi/ycS7B/YwJU OXih0FSY5JqA9lS24XDY+NzBA6MM8lkYXxHQ6r8UIMKlO1NkR+QoRYQCwNmI+Rcp5PVp BU0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XmqG0n32ktuAdZDprmZUiMMAlDSZyICjmp1qpej5fqw=; fh=EIRa5T5ig935kMTrBjMilyNn1EaRTjENIPYXRvLBmKY=; b=RH+grwA6LASM9zjJdPiBHUJA1/MwlE2QHTpOVoPkm6SkE28ba5CLreQqWMqlNgrsba p+nH9HNw9T6hizGtufl73YN4vAeQQ/noDLtoe3oqvESQZiLffAPNWvISZg1EX4D3rJMw NCgrvmKVRRY5k3goBOOb97dADyVSMVRaKkrnBytCGRGrznNcPBq5hMn1sbh1Z2S2iJFC cr2DmJUmRpN2Fp8uhZro72xaP32hjSRQ0cNc70hGftax4yi3DhWsmuZR+iX7PM6GXIxU PD3N8YQx7t2PsCx6AY4QU7LO0DE4Kh3qaDN2MQ7lfMfWOby6pX8EY3DXekk4yletOUsl wCkQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=OLkwRozU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4719-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4719-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l14-20020a17090a660e00b00286861858e1si621380pjj.26.2023.12.18.21.51.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 21:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4719-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=OLkwRozU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4719-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4719-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C5FA285CD1 for ; Tue, 19 Dec 2023 05:51:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC6B1D2E6; Tue, 19 Dec 2023 05:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="OLkwRozU" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2042.outbound.protection.outlook.com [40.107.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78D458F4D for ; Tue, 19 Dec 2023 05:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmSfd4vUn7psRWHSCcLOXH9zqmL2dDYptLhod3XPnEq+oAaRzbTSneXAHdBQuakrEtyfhPBZTGh85bwSHzvZBfMnAJg+R1DlTDonwKmS29y0sMOjJRLJi3h8Rx2kBaD8YtXcV0qFApTNQ8v8hYE1ThTx36YW2x/fPXEH3yHu9aofStbGZs8M8Ey9IDyQ6ogxFHMIX2WYz49VnJ4X/zp2LuwmZO+qAlvSJHAQkCg9EIkFq66tmHfb87u/+LddHb2ARg4p5b3Yb8UpJLSqnAYfDKu3/wR8WhPkqkWjNpzLlDhdwytmYE7pIy4bWK80L8FyOJOKvKrpnqZYz2JjqHGUbQ== 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=XmqG0n32ktuAdZDprmZUiMMAlDSZyICjmp1qpej5fqw=; b=eRmZTKjAKZAo12t2N/jqn7Kq8ktuyXAPioLfoKd1UrzxcVpoECz0AuZFxvmXmKmi4bmuWX+KypLr9KkUADZrlmraRmaFCwSVaBnexMB9wo6u1LNmeVgEFGzxdLTGOfmY093lvB6f9OpyNdNjnqWXNAR7x7+LqKm+P4eIEmPf2J2xxjA90QQWbVzTU5iGhT6zD06BelgLawAXf2/DGIHopVbIGC25a+mvJ6v4Hez5XsB7/1OhdRW0IJMXm0a3f6iPDnXlX8pgn34V16l+yK0HKhaYpOYgYB6itZbMqWASJJDHuddoTEJVDUlrelNDQ57g4PBn+6Jrs9FarVm36S4IqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.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 (0) 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=XmqG0n32ktuAdZDprmZUiMMAlDSZyICjmp1qpej5fqw=; b=OLkwRozUR/8gY4ZxWGLgShxXYXWFgJYAPfF062qSSL9rkWF2jxo+VKJKchsHZPWXYvHnSV0d0eZZKWAbBoeKd9+I/5j/JSWAqjkBQqNHQD2vz02FvGPSR9YgEoeLvLWJ8TG7rqX1smo4L3iVXlWTez0SLx1wga2GTH2FhLyrRk0= Received: from DM6PR01CA0023.prod.exchangelabs.com (2603:10b6:5:296::28) by PH7PR12MB7140.namprd12.prod.outlook.com (2603:10b6:510:200::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 05:50:48 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:5:296:cafe::2) by DM6PR01CA0023.outlook.office365.com (2603:10b6:5:296::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Tue, 19 Dec 2023 05:50:48 +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 DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 05:50:48 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.34; Mon, 18 Dec 2023 23:50:48 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 18 Dec 2023 23:50:47 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 18 Dec 2023 23:50:46 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH V2 1/2] firmware: xilinx: Export function to use in other module Date: Mon, 18 Dec 2023 21:50:24 -0800 Message-ID: <20231219055025.27570-2-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231219055025.27570-1-jay.buddhabhatti@amd.com> References: <20231219055025.27570-1-jay.buddhabhatti@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|PH7PR12MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c5090ba-00b1-445a-9e17-08dc00567385 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d7eTF5YU7gHQ4cDTLw4QHQrLs4Mp2KEq85BOnLmI+n5PDOmwCwzyEctVd6uOz51Hjb++GVk7tWiEQaO24IID/0Nq0y1ExZri8X1lEXfJsBCcEtUylRcBAuSDpGPwpQAmfiKaI+Waz6LINhTlE9ZrBJlnNsZqkv/qKDysOsAFnywz6yy0jldAY/FsWRGzCqIjD2fsjTJqs0Naw+om4tj6jTToKk8YSdGPT7QcknGzlCRrynSWp/NU0NUSm+cpoYmTwyn8WBK218FZPvKEPc3hwzYfdxRIVTcSWDleiLLupvezg16NvJlZ5Q0EoFMY+obN8LHK4tPQGKyJhShme58GG2NHXgzLGHCxFkitVoJ54tlulz1P+YbRFi+uJXncFwNS5SYgl/JkKFcms6duX8POCOABYc8oBncuFX3XuQgzFQiEzuUJlKPu3R16tUFiDHIT4/oUK+k7pPvmfflNsJbe6tHURejLaZWStBoCZi7Fg5ehTvnhyVjgEvb8jHr90zE4q9q742XIn8BKCvGfIJW8EQ7tVzHnK+Pl2z6uUW8wdWwNXtesSmNW6p/JzhbuQbfXK1dgz4KXzYnc2jr5xBrDNZ7RXERMHwdfWzFtaoy1n3qr8+ZsJ7MqUY0B7SO9eVuSOfsYodpqXoQ2opKbCbmubTjpnwhuipAQTK9gnuQNX371kZdwKunrheSetY2G6qbHP9W8xbpdGwY1oLCGjgEFtS2ehCGmcXwff9afUyRgWNk2Ald2vo1RPJsG3EJMUamZyo3Ht74pSD6y6gSNKs4FjqKQovwwkwl4FZp9s01J1v0= 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:(13230031)(4636009)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(82310400011)(64100799003)(186009)(451199024)(1800799012)(36840700001)(46966006)(40470700004)(40480700001)(86362001)(81166007)(356005)(36756003)(82740400003)(40460700003)(6666004)(478600001)(41300700001)(54906003)(6636002)(70206006)(70586007)(921008)(1076003)(336012)(26005)(2616005)(47076005)(83380400001)(426003)(2906002)(110136005)(44832011)(5660300002)(36860700001)(316002)(8936002)(8676002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 05:50:48.4310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c5090ba-00b1-445a-9e17-08dc00567385 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: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785688337432597098 X-GMAIL-MSGID: 1785688337432597098 Export zynqmp_pm_get_family_info() to access and find family information in other module. Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 3 ++- include/linux/firmware/xlnx-zynqmp.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index b0d22d4455d9..313965f79dd7 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -414,7 +414,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) +int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) { u32 ret_payload[PAYLOAD_ARG_CNT]; u32 idcode; @@ -439,6 +439,7 @@ static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) return 0; } +EXPORT_SYMBOL_GPL(zynqmp_pm_get_family_info); /** * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index d1ea3898564c..2375ce9b38df 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -515,6 +515,7 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); +int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily); int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); int zynqmp_pm_clock_enable(u32 clock_id); int zynqmp_pm_clock_disable(u32 clock_id); @@ -596,6 +597,11 @@ static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) return -ENODEV; } +static inline int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) +{ + return -ENODEV; +} + static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) { From patchwork Tue Dec 19 05:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 180762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1734791dyi; Mon, 18 Dec 2023 21:51:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFp1Eb45It16IdBNOmW6OF+sj6nuBExcg3QdCDWLIMw0Ho+lVltlS/imuUqjvyaEAqJvCz9 X-Received: by 2002:ac8:7e88:0:b0:425:9ff2:fafd with SMTP id w8-20020ac87e88000000b004259ff2fafdmr27325812qtj.5.1702965083427; Mon, 18 Dec 2023 21:51:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702965083; cv=pass; d=google.com; s=arc-20160816; b=tCL2dDadT0BccExMtfsnDbk9dX2FB69N0U4JncpAKrll3x8PyNddwfP4DgnCOuBpq9 iBE8QlhSOzhTh5mHqQ6NuKxvYg7ZLkHQl37Jg3aY9y7rMGYkxa3bS8Ap26yENgXx4t41 rLv0hnem1WB4T9tTrzYwOndxrmrIGEYI/rX9tLGnfqx+MLZuSN90J+2bqMQyHeqiMwIb 9klIt261824JFeWI7iJtEjzH/JUPRPhsax2zAVA4JrAqYyPGdvK6X6r6lxrWkBELjBoT QIAHpwq74qRAlUQyEDEbQunYvjYSthNNIXRxHhycX5Y3MMDai9hIHRORfZGZl+hnfqDX vcjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Pl441ahlHTJgUCOp3kTIl0zOknnarfPNDQF9OJv0zg=; fh=EIRa5T5ig935kMTrBjMilyNn1EaRTjENIPYXRvLBmKY=; b=Um9BLLZy+ORGEi0iJcLO4Av9J0K5KWqszJ14nufyQKTjrvDzdF+SPRa2d10LRE00Dw MQvehvIOkgDnyaMlk4Na79krN2OpYKdX05IAsPCW96aoobpOTKMn/wLQTSaCShC2BlMq HKd9Pll8pLRkSvvYGj751Nz75WT92LHjTrQLnwR/eIfzysmSurdbJ9i6IZYQADiTcrIr KdJbs8dLDITn/kO4x8OEobXU7Zqup8echl1F685sE6AaHCu8ohJ7z/Kmo85Dvgi/iJiD XhMQM5tozB/cVG/iwJAhFxPJ6KzNdT77sOl0rW2eR31jmf8J5dUPkcz0bv6lSwXExwtN HnTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="flwxG/s8"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4718-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4718-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x7-20020ac85f07000000b00427786eadc3si403944qta.299.2023.12.18.21.51.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 21:51:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4718-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="flwxG/s8"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4718-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4718-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1A67A1C23365 for ; Tue, 19 Dec 2023 05:51:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE3738BFD; Tue, 19 Dec 2023 05:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="flwxG/s8" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA9366FAE for ; Tue, 19 Dec 2023 05:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HLTXHyA8xxz++4ID3RtnnrejjHb1+qUNEhDUx6xJtXJmBFqLbz5S9wjK+wklbXvZH7QZYCYEvGUug/OS7+iV+hpCuzoZQUw8Sxq4BF0tgyW9RPwtsWDG5+vhUDjDLrtalP9bYZJvYfYrpyEw1tUDh/qPubEcPZOguKSSIKKx9l6S7wcQH8B1Wk8i3fwxf1SlwXbCopQojZ8u34bbRGiWfQLD+JWobSksbhMxDjDPa0sFrGeWeEpXOfL/TRF1U3KeaB6zScxZtYed6IDmtk/HKPgT29Q6biqBvG0SJ8OFJq0/5wS+kLk3dY/4rHks4lQXzDdlAW1Punkosr22Wdd5WA== 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=/Pl441ahlHTJgUCOp3kTIl0zOknnarfPNDQF9OJv0zg=; b=bJhjHm85uPRhC17oQIhhiamba3onPZVdOsS5cbqHIyKCtF4VjFMJsWy/QsvGRbkY1MXumyKD9uvAIJFAbkcPXeK8GbCJn22xaoyhi74gaH14b4jrY0K7LJvR2I2JIl6LNo760ymvNH+6Ar0qBZFCUPCKnvjQ+neMqIvomD9GYMi/wjAZ6U44p3rScl5V6sGgacYP/oNx7Ub9k/hzXumKVBbmvhGl1gjkp/ZQg4uPKT8Tw5zmORj4tIVYVbWox8nXDhex9aJ08pTBeol5vC98+Yc90navgh+TfUiZIE4ShYSz4rYwcLYMrslUNe5CN/6aP36T+/RKyxTsE+liArV4zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.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 (0) 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=/Pl441ahlHTJgUCOp3kTIl0zOknnarfPNDQF9OJv0zg=; b=flwxG/s8r0FfNFKmxq6QAVuUJL38mvLYSjPoRHqn7FBqOHdEZP5xs0OuwGImGuPP7KHx9sKxb1wDriJye13YwK7CVAg8T2sltuiwYvQbioxQYHVNZiG2llK5O/XKq3EDGWz9uxSRvzdlS4OH0vceTxFI5zi4ZWDxTNbDadu5jNg= Received: from DM6PR01CA0011.prod.exchangelabs.com (2603:10b6:5:296::16) by CYYPR12MB8752.namprd12.prod.outlook.com (2603:10b6:930:b9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 05:50:49 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:5:296:cafe::8e) by DM6PR01CA0011.outlook.office365.com (2603:10b6:5:296::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Tue, 19 Dec 2023 05:50:49 +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 DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 05:50:49 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.34; Mon, 18 Dec 2023 23:50:48 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 18 Dec 2023 23:50:47 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH V2 2/2] drivers: soc: xilinx: add check for platform Date: Mon, 18 Dec 2023 21:50:25 -0800 Message-ID: <20231219055025.27570-3-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231219055025.27570-1-jay.buddhabhatti@amd.com> References: <20231219055025.27570-1-jay.buddhabhatti@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|CYYPR12MB8752:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ee6bd79-91b5-4da6-0d8b-08dc00567417 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UoZa+yfqtiFxoc4Kvp3GXFw5jESul4o05NKKIsnTUYZsAbMFib0HivTOl5+dFZGXz4h3XVraSMYAuhpRjKDs96CiEEG5mMjqmNbkdV6oTjUxIlutB7cg4GeH62bGMzxaWduOSZCIZfehMz2AAz/a7nvBMXI60IYeE8gKTENvPQvxkEk4eGritpnRhmVVMLzjSJxxPPMbI1E9T1UFmClzyTYmo4WaN/uKfdBSp1GC5oG/3CdqQbGSveLIN8NYxviO5Ya0l0hiyhxmSnPxDxRDHBZ7C8PYh9FVewCX/EAbo+7Bf8UmHBpDQoZI7tv9GiUQYQP2zE2ryK2pgB2jh9S0xVzC4lWETZV+IAKa6PQGs44Hzk+zv8aSx+ur3cuLWAE0rrg8GHi19oXaPlacNgMoWf4k54BCPlaiegYs2TK0Aorup3UXN9SMai3lPSUvX0md2uTBBQgUjMhQUb5m7KuQn8SQ1b6X12cMf8w/E1z6H0okI2PvB1KeetK3EYKgenRZ9OyzKxzzhdL2fgXEcdoT4Ed0o8KCZKM1y+oNVeUfxMZIFh6MA558de08gyHaTvh5P+R2gn0Zv9MiAn2apWFkoJugXHdiFIOIBVuEiW8T7Lw/Vv3YxRV06PAanQGdnfjcPWr08YcvygztpQTJyrKRuKiq1KPGuE6OMI/jOcrziouLDZIvVqROcOveWPdGVoLdjSTM3L+4vFBqe4NpGHyoAkIXGh4uQjNDdacx6hwDtBHGSQb03GaLdkDoRI0ABtCgLuyxb+kexVrs+V6jZdshCx4a3GyJse+hK2W/96EJ8a4= 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:(13230031)(4636009)(376002)(39860400002)(346002)(136003)(396003)(230922051799003)(82310400011)(186009)(1800799012)(451199024)(64100799003)(40470700004)(46966006)(36840700001)(83380400001)(2616005)(6636002)(54906003)(70586007)(70206006)(110136005)(316002)(40480700001)(478600001)(26005)(426003)(1076003)(336012)(44832011)(47076005)(40460700003)(4326008)(8676002)(8936002)(6666004)(36860700001)(5660300002)(2906002)(86362001)(81166007)(356005)(36756003)(82740400003)(41300700001)(921008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 05:50:49.3685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ee6bd79-91b5-4da6-0d8b-08dc00567417 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: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8752 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785688315276404746 X-GMAIL-MSGID: 1785688315276404746 Some error event IDs for Versal and Versal NET are different. Both the platforms should access their respective error event IDs so use sub_family_code to check for platform and check error IDs for respective platforms. The family code is passed via platform data to avoid platform detection again. Platform data is setup when even driver is registered. Signed-off-by: Jay Buddhabhatti --- drivers/edac/versal_edac.c | 4 ++-- drivers/soc/xilinx/xlnx_event_manager.c | 25 ++++++++++++++++++++----- include/linux/firmware/xlnx-zynqmp.h | 16 ++++++++++++---- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/drivers/edac/versal_edac.c b/drivers/edac/versal_edac.c index 8625de20fc71..62caf454b567 100644 --- a/drivers/edac/versal_edac.c +++ b/drivers/edac/versal_edac.c @@ -1005,7 +1005,7 @@ static int mc_probe(struct platform_device *pdev) goto free_edac_mc; } - rc = xlnx_register_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1, + rc = xlnx_register_event(PM_NOTIFY_CB, VERSAL_EVENT_ERROR_PMC_ERR1, XPM_EVENT_ERROR_MASK_DDRMC_CR | XPM_EVENT_ERROR_MASK_DDRMC_NCR | XPM_EVENT_ERROR_MASK_NOC_CR | XPM_EVENT_ERROR_MASK_NOC_NCR, false, err_callback, mci); @@ -1042,7 +1042,7 @@ static int mc_remove(struct platform_device *pdev) debugfs_remove_recursive(priv->debugfs); #endif - xlnx_unregister_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1, + xlnx_unregister_event(PM_NOTIFY_CB, VERSAL_EVENT_ERROR_PMC_ERR1, XPM_EVENT_ERROR_MASK_DDRMC_CR | XPM_EVENT_ERROR_MASK_NOC_CR | XPM_EVENT_ERROR_MASK_NOC_NCR | diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index 86a048a10a13..78f9a3c6ae11 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -77,11 +77,26 @@ struct registered_event_data { static bool xlnx_is_error_event(const u32 node_id) { - if (node_id == EVENT_ERROR_PMC_ERR1 || - node_id == EVENT_ERROR_PMC_ERR2 || - node_id == EVENT_ERROR_PSM_ERR1 || - node_id == EVENT_ERROR_PSM_ERR2) - return true; + u32 pm_family_code, pm_sub_family_code; + + zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code); + + if (pm_sub_family_code == VERSAL_SUB_FAMILY_CODE) { + if (node_id == VERSAL_EVENT_ERROR_PMC_ERR1 || + node_id == VERSAL_EVENT_ERROR_PMC_ERR2 || + node_id == VERSAL_EVENT_ERROR_PSM_ERR1 || + node_id == VERSAL_EVENT_ERROR_PSM_ERR2) + return true; + } else { + if (node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR1 || + node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR2 || + node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR3 || + node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR1 || + node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR2 || + node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR3 || + node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR4) + return true; + } return false; } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 2375ce9b38df..2cfd78f232dc 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -91,10 +91,18 @@ /* * Node IDs for the Error Events. */ -#define EVENT_ERROR_PMC_ERR1 (0x28100000U) -#define EVENT_ERROR_PMC_ERR2 (0x28104000U) -#define EVENT_ERROR_PSM_ERR1 (0x28108000U) -#define EVENT_ERROR_PSM_ERR2 (0x2810C000U) +#define VERSAL_EVENT_ERROR_PMC_ERR1 (0x28100000U) +#define VERSAL_EVENT_ERROR_PMC_ERR2 (0x28104000U) +#define VERSAL_EVENT_ERROR_PSM_ERR1 (0x28108000U) +#define VERSAL_EVENT_ERROR_PSM_ERR2 (0x2810C000U) + +#define VERSAL_NET_EVENT_ERROR_PMC_ERR1 (0x28100000U) +#define VERSAL_NET_EVENT_ERROR_PMC_ERR2 (0x28104000U) +#define VERSAL_NET_EVENT_ERROR_PMC_ERR3 (0x28108000U) +#define VERSAL_NET_EVENT_ERROR_PSM_ERR1 (0x2810C000U) +#define VERSAL_NET_EVENT_ERROR_PSM_ERR2 (0x28110000U) +#define VERSAL_NET_EVENT_ERROR_PSM_ERR3 (0x28114000U) +#define VERSAL_NET_EVENT_ERROR_PSM_ERR4 (0x28118000U) /* ZynqMP SD tap delay tuning */ #define SD_ITAPDLY 0xFF180314