From patchwork Mon Jun 28 07:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Vaja X-Patchwork-Id: 12347323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9BDCC2B9F4 for ; Mon, 28 Jun 2021 07:06:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A5F5C61A0F for ; Mon, 28 Jun 2021 07:06:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5F5C61A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=q+Ahf3YVrsvVgCPrwC1t0YtOb8PDYoecg6Kdyo0ajBw=; b=pMOz+MKRUSSvfI dKSopQyuCHC0HWusJ/FZcF2ix2Mrea6QmBJLCnQq1uvXM6fUWnZfHvHtSGcfBnVgED3x1VQwAuVln YmagUGwDfvlcXxx6+02vOUp3f1AK4p2qV+E1kWLOW+vEZ/Kap+/qRIeDOkEitXEWPjAqiZ3resl8P hdc2azY/ECcP4Zt020F2b3FVDgcAgVvY35ZPPk9ciUUMy9ILeOipQPw9GxzlVdpka7NSgxxPTw3MQ vY5LTqt5XWi/+3IcqLI9umBQB0DxkV6T80SPSTPPMRjWVQ0xA05tPIpwP9KzijasF7hYdjK4RxlLe KvnFm+JUpHZEYalrcBkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlI9-0077uQ-As; Mon, 28 Jun 2021 07:02:49 +0000 Received: from mail-bn1nam07on2059.outbound.protection.outlook.com ([40.107.212.59] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlHV-0077iP-8N for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 07:02:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oBqIBsciAjKu9ohdKehK1wfRUZAZcoBx3vDlGkLZvahad+P/BzwJtiJ0M0xaPgOOn8u8epnV+K/m7pJ565jYog+2sbduMt4qaOYl+AUNZsoIWPMYOcaETkVm2SCWMUfEGMM3nEO73VKBMWrlKGU83S6BdqetQIhXow1iGrTSg00cw44Ui7mUD5ZkYgCXSKk04TN+nEb2tpXnKcQrTGMo7fBGx7jwdvHFPg47I77qHcITNS1N1tVzVSkkFHLYo5Cy7RoKZB3xk+EgBboQqJe7wesBMh19uDyXChcc3q8wrJfu9ASfj/lhEPNZ1nEi4fxlHWRfL27eAyjZpeErJEZnkg== 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-SenderADCheck; bh=XOMKaj8YIocOlF1Sui/2a6EWB9RxSJ7E6RkjX/Ik9q0=; b=P64IIpgOFxTGMiRqDhe9P4pxwBfQUQhK6oqZu8s5U8u4Vrx6F7i7/d//tXEqwNB2onLriZpUpIdwZ5Bputbo4y2rwfY0ffQYlca4j7PkA3TwlHicLoBpVlXMHpH6M8PvD6gRKBArxc4g2VqjRkhdS/eqXIXvD3trgBtWllR1tlFEobgG1wdcNZJO832tmkB6YXEInrQ7mb0kDH2cuek28wmqCEqnO6GYn6cJPVmdyu0kT1Ae0y+oRNlRuGWjQg1BWZT19el5TlCJf7RMmqAWJPrLSUg5/57RD/Dc5t3gfG4XVIdjr1kH0eUwpOlxSdbP01b9pXklh5cKkHziLGjwIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=baylibre.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XOMKaj8YIocOlF1Sui/2a6EWB9RxSJ7E6RkjX/Ik9q0=; b=H1EVzBdbyA+WGfNyI/zGOczwLGc1TID5lyHSzcrJylvp43qhxqhURVcKjgjKJVcIO/ZFVd599WwjclRvg4XUsvbsKPLDeni9Zy61cR31OOelehPix0NB6zvoA1dWu0WvV5pLlxjlGGEmSBOMug+Wr+a86HS0Sigi1eWJiu85UTA= Received: from DM6PR01CA0026.prod.exchangelabs.com (2603:10b6:5:296::31) by PH0PR02MB7752.namprd02.prod.outlook.com (2603:10b6:510:59::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Mon, 28 Jun 2021 07:02:06 +0000 Received: from DM3NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:5:296:cafe::e0) by DM6PR01CA0026.outlook.office365.com (2603:10b6:5:296::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; baylibre.com; dkim=none (message not signed) header.d=none;baylibre.com; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT004.mail.protection.outlook.com (10.13.5.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:06 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 00:02:03 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 28 Jun 2021 00:02:03 -0700 Received: from [172.19.2.91] (port=42476 helo=xsjjollys50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lxlHP-0000Ik-Jx; Mon, 28 Jun 2021 00:02:03 -0700 From: Rajan Vaja To: , , , , , CC: , , , Rajan Vaja Subject: [PATCH v6 1/4] clk: zynqmp: Use firmware specific common clock flags Date: Mon, 28 Jun 2021 00:01:19 -0700 Message-ID: <20210628070122.26217-2-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.32.0.93.g670b81a In-Reply-To: <20210628070122.26217-1-rajan.vaja@xilinx.com> References: <20210628070122.26217-1-rajan.vaja@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a5be53b-e048-4aa4-133f-08d93a02a3de X-MS-TrafficTypeDiagnostic: PH0PR02MB7752: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gt7PCRSrI8FGf90yKW9Kxj7OXxO94U4IbPCH3mD8QBhARdvhVdSIs7w1KdEIiF4JKkozjj4tVtqMGbgH5u7e8CUsvRjpuE1l81+GRnnR//kleNFC6liE+b081gpu9cOLWz7e4LO2BHh+lgv0rp1q5Nvw2sCc5pyQaxwjt5DdiPaT4YZR7U6PvKGCblisNtUip85vAY31B2ASEBzcKh40hxSsvVuJeuVCj0Ye0DII1r+13gyT/GJhBVLD1V7qukP2N4DYCVmypEUDOquBunSVTb4f+jJReXIZHXGX0vaX6R1fPUy40FHylhgY6XG7DtcWsTI3nlb/6oWqwC96Sb+mUoxSYtcdDbzYcapciKl0r9xzh/nyIm7YpRsWVyZPNpBFKRFJoMaqjGHgGDJ0TMpQRC+sMu1UNOpzrfkGRu7THaMP/JCn4QhVpbheSlu3CB/P/quoZBUWzHNQFECOPgRp+SkQeqPJ3z0m1T7OCk4+7Pw3ai1xNKVm73t4HRpBgEuPVOKSn6mFTnipy95HTGTdGawmflTDqoGAvLt6+XhOBH//1FR/Fg/V+1/eGRTl08Rg2BlO1Pw8vqJQOMvoF917gp8y92vJY2CDVigx0vhG1EIseAk7JndTMyAS5dP2YjV54FRk5P7jblzVk+Afu//UZyOXtWH4b0wd9/pqU8TO2F6lGY5rIFePXzXTn2TuUVYaxFe3zqkyTixRpx5RgJGCJTpxXGlDCejlUpbxIAZDNKY= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(39850400004)(136003)(396003)(376002)(46966006)(36840700001)(47076005)(70586007)(2906002)(1076003)(70206006)(36756003)(478600001)(426003)(8676002)(2616005)(5660300002)(44832011)(6666004)(36906005)(54906003)(336012)(7696005)(82740400003)(82310400003)(8936002)(9786002)(316002)(4326008)(83380400001)(186003)(356005)(7636003)(26005)(107886003)(36860700001)(110136005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 07:02:06.2302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a5be53b-e048-4aa4-133f-08d93a02a3de X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT004.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR02MB7752 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_000209_367948_650E999B X-CRM114-Status: GOOD ( 14.54 ) 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 Currently firmware passes CCF specific flags to ZynqMP clock driver. So firmware needs to be updated if CCF flags are changed. The firmware should have its own 'flag number space' that is distinct from the common clk framework's 'flag number space'. So define and use ZynqMP specific common clock flags instead of using CCF flags. Signed-off-by: Rajan Vaja --- drivers/clk/zynqmp/clk-gate-zynqmp.c | 4 +++- drivers/clk/zynqmp/clk-mux-zynqmp.c | 4 +++- drivers/clk/zynqmp/clk-zynqmp.h | 16 ++++++++++++++++ drivers/clk/zynqmp/clkc.c | 25 ++++++++++++++++++++++++- drivers/clk/zynqmp/divider.c | 5 +++-- drivers/clk/zynqmp/pll.c | 4 +++- 6 files changed, 52 insertions(+), 6 deletions(-) diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index 10c9b889324f..695feaa82da5 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -121,7 +121,9 @@ struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id, init.name = name; init.ops = &zynqmp_clk_gate_ops; - init.flags = nodes->flag; + + init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag); + init.parent_names = parents; init.num_parents = 1; diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c index 06194149be83..a49b1c586d5e 100644 --- a/drivers/clk/zynqmp/clk-mux-zynqmp.c +++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c @@ -120,7 +120,9 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id, init.ops = &zynqmp_clk_mux_ro_ops; else init.ops = &zynqmp_clk_mux_ops; - init.flags = nodes->flag; + + init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag); + init.parent_names = parents; init.num_parents = num_parents; mux->flags = nodes->type_flag; diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h index 5beeb41b29fa..aa013a59c7cc 100644 --- a/drivers/clk/zynqmp/clk-zynqmp.h +++ b/drivers/clk/zynqmp/clk-zynqmp.h @@ -10,6 +10,20 @@ #include +/* Common Flags */ +/* must be gated across rate change */ +#define ZYNQMP_CLK_SET_RATE_GATE BIT(0) +/* must be gated across re-parent */ +#define ZYNQMP_CLK_SET_PARENT_GATE BIT(1) +/* propagate rate change up one level */ +#define ZYNQMP_CLK_SET_RATE_PARENT BIT(2) +/* do not gate even if unused */ +#define ZYNQMP_CLK_IGNORE_UNUSED BIT(3) +/* don't re-parent on rate change */ +#define ZYNQMP_CLK_SET_RATE_NO_REPARENT BIT(7) +/* do not gate, ever */ +#define ZYNQMP_CLK_IS_CRITICAL BIT(11) + enum topology_type { TYPE_INVALID, TYPE_MUX, @@ -33,6 +47,8 @@ struct clock_topology { u8 custom_type_flag; }; +unsigned long zynqmp_clk_map_common_ccf_flags(const u32 zynqmp_flag); + struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, const char * const *parents, u8 num_parents, diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c index db8d0d7161ce..871184e406e1 100644 --- a/drivers/clk/zynqmp/clkc.c +++ b/drivers/clk/zynqmp/clkc.c @@ -271,6 +271,26 @@ static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index, return ret; } +unsigned long zynqmp_clk_map_common_ccf_flags(const u32 zynqmp_flag) +{ + unsigned long ccf_flag = 0; + + if (zynqmp_flag & ZYNQMP_CLK_SET_RATE_GATE) + ccf_flag |= CLK_SET_RATE_GATE; + if (zynqmp_flag & ZYNQMP_CLK_SET_PARENT_GATE) + ccf_flag |= CLK_SET_PARENT_GATE; + if (zynqmp_flag & ZYNQMP_CLK_SET_RATE_PARENT) + ccf_flag |= CLK_SET_RATE_PARENT; + if (zynqmp_flag & ZYNQMP_CLK_IGNORE_UNUSED) + ccf_flag |= CLK_IGNORE_UNUSED; + if (zynqmp_flag & ZYNQMP_CLK_SET_RATE_NO_REPARENT) + ccf_flag |= CLK_SET_RATE_NO_REPARENT; + if (zynqmp_flag & ZYNQMP_CLK_IS_CRITICAL) + ccf_flag |= CLK_IS_CRITICAL; + + return ccf_flag; +} + /** * zynqmp_clk_register_fixed_factor() - Register fixed factor with the * clock framework @@ -292,6 +312,7 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id, struct zynqmp_pm_query_data qdata = {0}; u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; + unsigned long flag; qdata.qid = PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS; qdata.arg1 = clk_id; @@ -303,9 +324,11 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id, mult = ret_payload[1]; div = ret_payload[2]; + flag = zynqmp_clk_map_common_ccf_flags(nodes->flag); + hw = clk_hw_register_fixed_factor(NULL, name, parents[0], - nodes->flag, mult, + flag, mult, div); return hw; diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index e9bf7958b821..0becdc0a8bff 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -312,8 +312,9 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, init.name = name; init.ops = &zynqmp_clk_divider_ops; - /* CLK_FRAC is not defined in the common clk framework */ - init.flags = nodes->flag & ~CLK_FRAC; + + init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag); + init.parent_names = parents; init.num_parents = 1; diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index abe6afbf3407..e0bceb07740f 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -312,7 +312,9 @@ struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, init.name = name; init.ops = &zynqmp_pll_ops; - init.flags = nodes->flag; + + init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag); + init.parent_names = parents; init.num_parents = 1; From patchwork Mon Jun 28 07:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Vaja X-Patchwork-Id: 12347327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F21DFC2B9F4 for ; Mon, 28 Jun 2021 07:06:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C7BB461A0F for ; Mon, 28 Jun 2021 07:06:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7BB461A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=vIE49fhYd5HSBivTMQU2bmsGDvchCGwLrQ37guGIKZc=; b=oiWbBaKw+pARne fFSe1hgc/5BKJm+V0kjhWAxBzursujdR/cXGyPcPzgMk0jQh1DWzsp7BZTJvv029k7YVEEuZ3QOIQ rkTpNduUnz4+opZF47MQKX/bkQEur8O0XhIRby52kSI24d4+713s5xbLBafEIL00PMPjMFBfAs0Om qW1uQClrZnyOvz5uZk8NrZoEOVJEjKoBKLVkgRSh0o89jcc16MSZwwKqxvMA+qDYmpbCqfrzp+uD+ BNZnLOHKmic7DK0ce8L/akHIXVlLeLzN207AZ/JcZunKNiM3V9AKYY3U9u7ROLna8m0M1JNLlwp5S ZkvGNV47j7iRaI0uYMfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlIq-00788N-5v; Mon, 28 Jun 2021 07:03:32 +0000 Received: from mail-mw2nam08on2085.outbound.protection.outlook.com ([40.107.101.85] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlHe-0077lH-QW for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 07:02:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MoHqtSAnM9NwZVcPkFiHzZ2dXKeRx0/xN8K/1gZUD5dBHCyD7sb1ADUy8/x7FYBDeOWKPGKqaVOQl6Gm8ivjSt7aEkhE3FmIDzxQYBJG5zA6DQKW8xlweFtwdVsruT4vomeHoyWNBHucWQRu7XRxroE6h0/YRNO9QNfALy3+le82LWWf51Yzmi9PxPzK7pQ5GuCfl026RdzNbQiVmi2grwiuaD8JlTrV/9fRSqOq6640rxQQMV4n4ayDdHIkR3ZzudO5WF4SALhMflKIeV49w8I4YdEZ4hnH7x1I+NjhHPvTJTlrD7caqduUzQaH2h8M/7yxVMpr8KCSgsrCIgxCjg== 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-SenderADCheck; bh=vhlVUi4lv652qpQujF/BDsTHYG250X1r6wcmnzUHoAM=; b=HjB95FlQ6c4WTDLXxl1VxWns3yxdX9x9cpMlCaWnGXtMvFUVqyCwPZBDk87Cg4IIi66orRrl57Z2k5XUJANACwvtRt6pDtFdJIhFTv1ljtvtyuwysQ5RmdGW9NRbLed34ipfteRdClKYQ0lTX/A5VnsCiULD8EKksOOr4Kzq9ImmfA8tzY0QHeaY5bWg0tZmGuPPG2XJI1anS5Z5C9aJvNsgisiTWIpH9sBg5JLwmXLTSffGAgv6OidnrG2rnphI02sawv/Cvo/pnofv8U0bJXGHUlLqWdpqt84V/Aom5m/bmxzbN0Ts1H1mztUSEUSY28TFP6zdKjljIgX+kzJJGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=baylibre.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vhlVUi4lv652qpQujF/BDsTHYG250X1r6wcmnzUHoAM=; b=P5rPZKlA0Mew8VN2TLUDOKZ6lJov88wlTVugqZXNiP6FGO8Q4/buQKpUxZ7k1IvkyosdD4kgrU7b5S8caoO4EcSLUgblpwp2UwZpTSKE16RNqXTR+x/V5dTi9bfRYynfV29UAUnsGooXhp2UQML3xGyeWYH0wwKzFJT3JqJ2RI4= Received: from DM6PR18CA0034.namprd18.prod.outlook.com (2603:10b6:5:15b::47) by SN1PR02MB3885.namprd02.prod.outlook.com (2603:10b6:802:2d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Mon, 28 Jun 2021 07:02:14 +0000 Received: from DM3NAM02FT057.eop-nam02.prod.protection.outlook.com (2603:10b6:5:15b:cafe::a2) by DM6PR18CA0034.outlook.office365.com (2603:10b6:5:15b::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; baylibre.com; dkim=none (message not signed) header.d=none;baylibre.com; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT057.mail.protection.outlook.com (10.13.5.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:14 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 00:02:04 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 28 Jun 2021 00:02:04 -0700 Received: from [172.19.2.91] (port=42476 helo=xsjjollys50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lxlHP-0000Ik-Tr; Mon, 28 Jun 2021 00:02:03 -0700 From: Rajan Vaja To: , , , , , CC: , , , Rajan Vaja Subject: [PATCH v6 2/4] clk: zynqmp: Use firmware specific divider clock flags Date: Mon, 28 Jun 2021 00:01:20 -0700 Message-ID: <20210628070122.26217-3-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.32.0.93.g670b81a In-Reply-To: <20210628070122.26217-1-rajan.vaja@xilinx.com> References: <20210628070122.26217-1-rajan.vaja@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99c29697-c106-41a9-e602-08d93a02a888 X-MS-TrafficTypeDiagnostic: SN1PR02MB3885: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:873; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PsoxO0z/KKO8Lz9CsscZxXFz802AIno693fplZ0MLa02tbGppF0qj8aYoH9cSnwgTUiEk9rwYwVbHMGjqqJwmDfbro1yElwLIM2jj5bz4aXGaxrjhgo+sknKOFPZtNpfH5YTBNVgB1gCPQzlFk6njs+ueen58Pl/S3vnqU538OXj3F0UMeQzHh6OuNpZ/q142fjFt4JlCgayOMMAjEZ/vdFGo+pWxB075e7AT+dEh9ZojTegWqjpC/G8YMJ/tgsrGcY6kKg6k3aDpsN4Grt3cFKJ969MAAcuA57/PMtVRgExxPhKbzxwM4NmSgfXkJ6HmtDtIA+t/mx5iRALCVvOfPcUrbxo7Z5jvdoq83DRAs7WlaJV1U8BVTvYKpsRHh7DZdin8snpYj5Qzv/NebOo91pi/PnkuOTXiN46xleVqQyWMGk38nKJ9aboYizj5ncZ2+oQLsd/ZnkSPwZAzpvB5OUXtsKcwJnBFwUXGrQbG51cXjVwtFdrfA8dEeY92C/ixtbYqewRgK8rWrAS7yGdLL7iTniA3apJ57S/hnl990Lco4PTZ6UJVlARHJK+J9G0otHlca8fLAc05wLAD5s/SHxfppw92E/V13u3M38Rm9aJVeghbrVHvn5SxSPTKv5q6f1bJnooYAojsAql05hmTa0mYzS+ULbGbeASlfbYXfKs6f6yLc70P5G1JGZ5PeRNSf9foaDckk8lhUqzMKY8gEcNgjn2gLnwYZiYv+aPubw= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(136003)(346002)(39850400004)(376002)(36840700001)(46966006)(70586007)(9786002)(110136005)(426003)(2616005)(44832011)(186003)(7696005)(4326008)(8676002)(107886003)(356005)(6666004)(8936002)(36860700001)(82310400003)(54906003)(82740400003)(1076003)(47076005)(5660300002)(7636003)(2906002)(336012)(36756003)(70206006)(316002)(83380400001)(36906005)(478600001)(26005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 07:02:14.0625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99c29697-c106-41a9-e602-08d93a02a888 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT057.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB3885 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_000218_951358_1864C35E X-CRM114-Status: GOOD ( 10.18 ) 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 Use ZynqMP specific divider clock flags instead of using CCF flags. Signed-off-by: Rajan Vaja --- drivers/clk/zynqmp/clk-zynqmp.h | 9 +++++++++ drivers/clk/zynqmp/divider.c | 25 ++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h index aa013a59c7cc..925a727eb383 100644 --- a/drivers/clk/zynqmp/clk-zynqmp.h +++ b/drivers/clk/zynqmp/clk-zynqmp.h @@ -24,6 +24,15 @@ /* do not gate, ever */ #define ZYNQMP_CLK_IS_CRITICAL BIT(11) +/* Type Flags for divider clock */ +#define ZYNQMP_CLK_DIVIDER_ONE_BASED BIT(0) +#define ZYNQMP_CLK_DIVIDER_POWER_OF_TWO BIT(1) +#define ZYNQMP_CLK_DIVIDER_ALLOW_ZERO BIT(2) +#define ZYNQMP_CLK_DIVIDER_HIWORD_MASK BIT(3) +#define ZYNQMP_CLK_DIVIDER_ROUND_CLOSEST BIT(4) +#define ZYNQMP_CLK_DIVIDER_READ_ONLY BIT(5) +#define ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO BIT(6) + enum topology_type { TYPE_INVALID, TYPE_MUX, diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index 0becdc0a8bff..c07423e03bc8 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -284,6 +284,29 @@ static u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type) return ret_payload[1]; } +static inline unsigned long zynqmp_clk_map_divider_ccf_flags( + const u32 zynqmp_type_flag) +{ + unsigned long ccf_flag = 0; + + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_ONE_BASED) + ccf_flag |= CLK_DIVIDER_ONE_BASED; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO) + ccf_flag |= CLK_DIVIDER_POWER_OF_TWO; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_ALLOW_ZERO) + ccf_flag |= CLK_DIVIDER_ALLOW_ZERO; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO) + ccf_flag |= CLK_DIVIDER_HIWORD_MASK; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_ROUND_CLOSEST) + ccf_flag |= CLK_DIVIDER_ROUND_CLOSEST; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_READ_ONLY) + ccf_flag |= CLK_DIVIDER_READ_ONLY; + if (zynqmp_type_flag & ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO) + ccf_flag |= CLK_DIVIDER_MAX_AT_ZERO; + + return ccf_flag; +} + /** * zynqmp_clk_register_divider() - Register a divider clock * @name: Name of this clock @@ -321,7 +344,7 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, /* struct clk_divider assignments */ div->is_frac = !!((nodes->flag & CLK_FRAC) | (nodes->custom_type_flag & CUSTOM_FLAG_CLK_FRAC)); - div->flags = nodes->type_flag; + div->flags = zynqmp_clk_map_divider_ccf_flags(nodes->type_flag); div->hw.init = &init; div->clk_id = clk_id; div->div_type = nodes->type; From patchwork Mon Jun 28 07:01:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Vaja X-Patchwork-Id: 12347325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B2B6C2B9F4 for ; Mon, 28 Jun 2021 07:06:38 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EE48861A0F for ; Mon, 28 Jun 2021 07:06:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE48861A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=mXunBm+RbQzmMyRNt35IytKrjq//N4ZNvHX5kqyvdd8=; b=yZM+z9dXNgRdPY iGIUYvBlg5tsBAZI5gQkAFyfe1m0zbYaqBoDFPLIU1g4Ntlw0LE0MN7Blnd4ItXvFXclhgJfv58Bn IKIkbKff+dhSExfEDMi004m7oAoskz0s/vx7vTiKquj5onDAzxmqV5ihtwNRzHa0IuokzkglU0emf 49UJS9qN7FvAmB/wzhKuMDfboRrRfdZ1/z07fLUZknhVxN648buwslLAK5ncQXz0GeBSMVTgzGHra 4yHKx0lu//AfAxm1YhIcA9KZ1tkBPJUyciy066L4XpFR3HzqripsbyxdTvZG/t6IS9reGiv1EL2/m Cc081PgEiFJdsK64Ee5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlIW-007822-W6; Mon, 28 Jun 2021 07:03:13 +0000 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlHe-0077lC-Hg for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 07:02:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oXUvksqVte3+oAd4J8RN/MVi+bJkdAd/TM0YcRmq6SWCE0oQcVe+qqRW1U7Kmzw2brWTpmN/45cBgd6CPHwwtvnr4zq6hUxZLXEYC61fsirtPFZ+ynlIThXVUG6XproBEj73YpPnvLmrFZvOeYcdaEBh/mpI5dvgrKm16EFN5vtZjkmOylmxfqFA3fTNgL3UBeM3lS7wOWyKtQoISpNp+3v3mYx5hUOXEBW4d/9j4H4jOFYKb82FAF9fDl6RitZjddppPOf8dixkYg1/zF+aaqx9gV+6vDP1MugEKFjNKNfaksHj27J6eVcobcdRtsrLyHaixXbLKfSGTlukHt28sg== 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-SenderADCheck; bh=mjYMcdwrzNI5k3hRbGPSBUTtahunbwSyaqqWYchmiwE=; b=BIuZXWnOS+0J2sxaYVwaj1+A2ioWQwMNSfLRJmDjMPzY8NK3sg8pNyqlssIoFR6jqNeGOHPCZyS194KB1B5DkKZTMJzu+Tldx8QE8GeRbcp01l22swEcwhebMX0e9+/gLDhGsebRrUtTlET1bqlrotgKBt20M5MRuEOCisvjeeF7JxrwFrb88HaV6heOLt0VeR+ApaTx7lEY0/lyQYEWNUXx7QruQLOEClrOoHocrF30JBCWUS3fJZiSsKMANdJL3/4RFZgYm1rGLgYtfjBVmhIGo6F/PNJQ73GT1YVC6+kOndOTgoJ4tHytrxf4GhO13ulV52sVIum98Kv3NCI+6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=baylibre.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mjYMcdwrzNI5k3hRbGPSBUTtahunbwSyaqqWYchmiwE=; b=agmte6r7/NWJOP1mhzvKnhmTIuX3MRlrIgt2yC8lYFXnpv4KB90ivs1/OfXkAodqN3BKrewxqNrDBGyYtF0jtmeYVkvPHQBrP+hN7dyRvMIRZdruoztLAeERn6jPBewKMtN/U9RcBUYN1sdB3yBy0zXJ/ablDEiuZiI3ynLpq/Q= Received: from DM6PR18CA0002.namprd18.prod.outlook.com (2603:10b6:5:15b::15) by BN0PR02MB7917.namprd02.prod.outlook.com (2603:10b6:408:160::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19; Mon, 28 Jun 2021 07:02:14 +0000 Received: from DM3NAM02FT057.eop-nam02.prod.protection.outlook.com (2603:10b6:5:15b:cafe::a6) by DM6PR18CA0002.outlook.office365.com (2603:10b6:5:15b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; baylibre.com; dkim=none (message not signed) header.d=none;baylibre.com; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT057.mail.protection.outlook.com (10.13.5.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:14 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 00:02:04 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 28 Jun 2021 00:02:04 -0700 Received: from [172.19.2.91] (port=42476 helo=xsjjollys50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lxlHP-0000Ik-V0; Mon, 28 Jun 2021 00:02:03 -0700 From: Rajan Vaja To: , , , , , CC: , , , Rajan Vaja Subject: [PATCH v6 3/4] clk: zynqmp: Use firmware specific mux clock flags Date: Mon, 28 Jun 2021 00:01:21 -0700 Message-ID: <20210628070122.26217-4-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.32.0.93.g670b81a In-Reply-To: <20210628070122.26217-1-rajan.vaja@xilinx.com> References: <20210628070122.26217-1-rajan.vaja@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4f358bf-c73b-4399-7585-08d93a02a8e7 X-MS-TrafficTypeDiagnostic: BN0PR02MB7917: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:989; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S+NutCgaOXxFzp0S9yy77WnfzHqDznOygeqjwebuM3IbQFFFq8f+eKZRb30G8rVGp1DDCs2OhRbLA9K+tl+7PHyLZzJgBu6JvsOOX17sgWqe8NXtSNJHDmBL4kd+x89h7INcdRm+X/yEQ6uUJs68LB10sIQSemItGruj+KcNs3LQP0LAy0apjy5fi/OhTNqRUfcZKW3/6L6XEpGudTOMID9QByJaTXAziCMbYKB5dFgdX0+f5GxOrnituQDe3xWJHUjDk8GXFaRdvxgvo1s8ob6AY7rAdc/9aNsMyWhYxr2nSBiIpe/q+H3UBtYeOtlal6SeCGQLkZeB1BV4Wj0tGBb3qBRZ+tsBMuu6qr4VuFXm+m5buFQk7qacVto4oeS3OX3/746uLGaqRMrvEIC2aUZ6GpIn4qj+CjlwrduOOfCXi57Nx5Fv4sueBP0LcaN+8JuYYZjTuU6MClp7kObcRDz2mCmcV6aUYuPrk+SinZ7QRVh1l/SGN6+AKZ1PRXLWD22BvD8DltXgajeuSoexoa7jvYTVXyfR2t+XJDQGB+g8k1M/CfBF9JsA41QzEXcSST8n1h4qGoER38UXnWMUDB1ToM29aaigfQg/RCSaCsQZmOaPI9FM0e9MD83DuBZQrdCKLHFhqE0A8UrWFOve6tV90QEao+WPhsgnrZ/8UUczV7tNeREYSJ6KAq49yT6V X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39850400004)(396003)(376002)(346002)(136003)(36840700001)(46966006)(6666004)(1076003)(8676002)(70206006)(8936002)(70586007)(7636003)(47076005)(82310400003)(82740400003)(2906002)(9786002)(83380400001)(356005)(5660300002)(36756003)(478600001)(426003)(54906003)(44832011)(2616005)(336012)(36860700001)(26005)(7696005)(36906005)(316002)(4326008)(186003)(107886003)(110136005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 07:02:14.6823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4f358bf-c73b-4399-7585-08d93a02a8e7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT057.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7917 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_000218_641952_C1506EBE X-CRM114-Status: GOOD ( 11.35 ) 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 Use ZynqMP specific mux clock flags instead of using CCF flags. Signed-off-by: Rajan Vaja --- drivers/clk/zynqmp/clk-mux-zynqmp.c | 23 ++++++++++++++++++++++- drivers/clk/zynqmp/clk-zynqmp.h | 8 ++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c index a49b1c586d5e..4c28b4d8d122 100644 --- a/drivers/clk/zynqmp/clk-mux-zynqmp.c +++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c @@ -90,6 +90,27 @@ static const struct clk_ops zynqmp_clk_mux_ro_ops = { .get_parent = zynqmp_clk_mux_get_parent, }; +static inline unsigned long zynqmp_clk_map_mux_ccf_flags( + const u32 zynqmp_type_flag) +{ + unsigned long ccf_flag = 0; + + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_INDEX_ONE) + ccf_flag |= CLK_MUX_INDEX_ONE; + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_INDEX_BIT) + ccf_flag |= CLK_MUX_INDEX_BIT; + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_HIWORD_MASK) + ccf_flag |= CLK_MUX_HIWORD_MASK; + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_READ_ONLY) + ccf_flag |= CLK_MUX_READ_ONLY; + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_ROUND_CLOSEST) + ccf_flag |= CLK_MUX_ROUND_CLOSEST; + if (zynqmp_type_flag & ZYNQMP_CLK_MUX_BIG_ENDIAN) + ccf_flag |= CLK_MUX_BIG_ENDIAN; + + return ccf_flag; +} + /** * zynqmp_clk_register_mux() - Register a mux table with the clock * framework @@ -125,7 +146,7 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id, init.parent_names = parents; init.num_parents = num_parents; - mux->flags = nodes->type_flag; + mux->flags = zynqmp_clk_map_mux_ccf_flags(nodes->type_flag); mux->hw.init = &init; mux->clk_id = clk_id; diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h index 925a727eb383..84fa80a969a9 100644 --- a/drivers/clk/zynqmp/clk-zynqmp.h +++ b/drivers/clk/zynqmp/clk-zynqmp.h @@ -33,6 +33,14 @@ #define ZYNQMP_CLK_DIVIDER_READ_ONLY BIT(5) #define ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO BIT(6) +/* Type Flags for mux clock */ +#define ZYNQMP_CLK_MUX_INDEX_ONE BIT(0) +#define ZYNQMP_CLK_MUX_INDEX_BIT BIT(1) +#define ZYNQMP_CLK_MUX_HIWORD_MASK BIT(2) +#define ZYNQMP_CLK_MUX_READ_ONLY BIT(3) +#define ZYNQMP_CLK_MUX_ROUND_CLOSEST BIT(4) +#define ZYNQMP_CLK_MUX_BIG_ENDIAN BIT(5) + enum topology_type { TYPE_INVALID, TYPE_MUX, From patchwork Mon Jun 28 07:01:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Vaja X-Patchwork-Id: 12347321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47971C2B9F4 for ; Mon, 28 Jun 2021 07:05:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 07ECA61A0F for ; Mon, 28 Jun 2021 07:05:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07ECA61A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=inwSNw6JqRivcqDIUBdQziTLKKOx/qA8NyhkD9LhOlE=; b=gKvGgXe4PHFgqk z1PnINWIQZsUP2v0uXfpMqoRfBGzEHzI2J7AYJOpMQBFY6D1I/8uiI+Jxv4hDoBL36SEAkR5NjeeX joyVztdgvNj5o/Z2G0fumu/jdDl2xeM5FAvQcY7wxQCBO0xfM60TUVM/5SPNw3XK0lqhc0+BvFWnB K1ieeknDPhsoJYlwSsv1RrX7f6cJHX3xEsEuGbcB3ioW9q0j+j08eV0s7tFubFVQgYCUjqWUUBFQf xmTgQ3TL2aGvQ53nzAU7s304Ze0TaH4nyTS//ZeERBFEtvk88V+7aP6dlB4LNL/SnAFvGdeSaPXqa wQ2A37AFLei7jgSzZOhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlHo-0077oE-Sk; Mon, 28 Jun 2021 07:02:29 +0000 Received: from mail-bn8nam08on2070.outbound.protection.outlook.com ([40.107.100.70] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxlHV-0077iE-5C for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 07:02:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UukmovKUZHBZzihN1XDVa1ZCN6XtbGJmV/w7vho1YtQnejV1mNlcMlpPDnwq4hvxfQ9iOqf2C39+rXn9izIslAYDQQulNq+At8FGFfXgK5SqxsaxzJeQjvDKtK3OBaog7B0igvBUxlMg4vN9InGIBDfwvre93vPAAju0xmYCFUUbQlq9wHXS2vseuQ1EUls1Z0rEwDVtN2Bz2O+JBrRU7jDKsE8GvtP4cnqlKGyMicQ9zzY3qBzV0JlaEA63Yq+AaaY5VKiHScysWr5+4oFT96m/dBVa63tCFmbHUtelkhe0rigB2RKri0Y2AXhe2TEVGeKvvBMIo/I691/1z+Df7w== 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-SenderADCheck; bh=GUxnbZnjlx5+Up8acUATpYz5cHAbBdRpSaf1Ew1Gj/4=; b=U36FwV3GYOJO/GoTCFUKFJSouVHw09TdOlU2x9PdBDL42xa+SjoapNPbBG846MeegpZqhKduSYorTikblo2bjyoo7M7N0O1anjtJQuGIhIZFQjLjfiw7ulQNZOaCvUMomwejjI53k97LxvFqqmFEnLzjAI9oHnrYwv3LcfjdR0tICA9AanuGSVUnjfPScnf6azsJpblCrXI4Pje0E6iAnSSbwhlye5+3QcPzBLfZ0AkXDhAb5u+1ViTTiFPWykYoWvFVUXTozAheYW+vaKbCM1kXeuz1sZD78Mqg/JX5dj4vjP//IWdUEl3vxD7dx/6FQlSiE+10LuRRhjSIVDS1sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=baylibre.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GUxnbZnjlx5+Up8acUATpYz5cHAbBdRpSaf1Ew1Gj/4=; b=YjCEP6ErY2KDOGXJTUqLsYLqBt/g1Mo7SxAYLbEH4Mva2kQtsH8DZtr0rtGHTdeRKJBL6KW5ASPDi9xzckAoWRZEtIhrBvArx/bMLqdYBzpelUrBfgjfznBQrZtbluBzNGIj7CaC4jUvb+aHPpIaNy5akslHJxuCFZOvMmekjnY= Received: from SN4PR0601CA0018.namprd06.prod.outlook.com (2603:10b6:803:2f::28) by CH2PR02MB6056.namprd02.prod.outlook.com (2603:10b6:610:b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.22; Mon, 28 Jun 2021 07:02:05 +0000 Received: from SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2f:cafe::53) by SN4PR0601CA0018.outlook.office365.com (2603:10b6:803:2f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; baylibre.com; dkim=none (message not signed) header.d=none;baylibre.com; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0013.mail.protection.outlook.com (10.97.4.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 07:02:05 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 00:02:04 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 28 Jun 2021 00:02:04 -0700 Received: from [172.19.2.91] (port=42476 helo=xsjjollys50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lxlHP-0000Ik-Vx; Mon, 28 Jun 2021 00:02:04 -0700 From: Rajan Vaja To: , , , , , CC: , , , Rajan Vaja Subject: [PATCH v6 4/4] clk: zynqmp: Handle divider specific read only flag Date: Mon, 28 Jun 2021 00:01:22 -0700 Message-ID: <20210628070122.26217-5-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.32.0.93.g670b81a In-Reply-To: <20210628070122.26217-1-rajan.vaja@xilinx.com> References: <20210628070122.26217-1-rajan.vaja@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2ab5f23-bc3e-4b0c-9d61-08d93a02a335 X-MS-TrafficTypeDiagnostic: CH2PR02MB6056: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:489; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vkOL61zdJrfLcjJVrkGAobLjkqF4adrtaLApoF01768NuYwfDnXq3LqMb1fmWIh/Q544QdBhe1gfNTxF7XUMC9MkPWi7mS/qdnW7S27osUSUxVBkaBC0Yk+wtJEqGBTVr31dzoLJH9/PFL18fjsCnC9tFJ+vyst8lE0y47lPtTCd8hz0yIhHWeHaJHOO0DDYnBjAPNuhAa6vcbWRGUZ7H1nu7Ch7Nthx2+RlSazlggGJJYlSm0rCAvu3PdWsN1JjIMcRaUltiT9jgiK2Wt2YQSFYNwROSY7lx8CiSh0wF1ioKYXLhGg8ghvnAxVClqefMfcszrhj1deWETssj4qdWKfVHPSuWKvubePYDIYCY4y087j1ApvVdvW8m7njaEzCpNLePscHCiKzGTRGjUxCAiQwntKfQOJIDS/qjFDd+HRhY1PtuyJZoFf/CHo9MobCoMa0H69MVjxDjsMDvo1tx9y+E9wuGKrRx/XYcPMxs2bScjCCZqz+35x/wLVNsuxr0r2CUhHphpqxrVBd6pBtnhDPE7hrcRevcvBP1xDtUUdciQ4wN5ZTuIOVv4hP/FCS4h3+sIQPCzrLStzyNje0PGIPbkD6s0CKJnkDzzaxzFi+iRx5iJQvKiksnOordiQbCF5gQcDfDJmHYRHpLfIvuaIDUbPPN8Cc8ciuwGUiXOUyPsgvmSHpemaVcBGP6dHF X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39850400004)(376002)(36840700001)(46966006)(36756003)(82740400003)(4326008)(36906005)(44832011)(110136005)(336012)(83380400001)(9786002)(316002)(7636003)(8936002)(426003)(107886003)(82310400003)(1076003)(2616005)(8676002)(7696005)(70586007)(2906002)(5660300002)(47076005)(26005)(186003)(6666004)(54906003)(70206006)(478600001)(36860700001)(356005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 07:02:05.1381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2ab5f23-bc3e-4b0c-9d61-08d93a02a335 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6056 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_000209_269858_3C823C2F X-CRM114-Status: GOOD ( 10.69 ) 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 Add support for divider specific read only CCF flag (CLK_DIVIDER_READ_ONLY). Signed-off-by: Rajan Vaja --- drivers/clk/zynqmp/divider.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index c07423e03bc8..cb49281f9cf9 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -256,6 +256,11 @@ static const struct clk_ops zynqmp_clk_divider_ops = { .set_rate = zynqmp_clk_divider_set_rate, }; +static const struct clk_ops zynqmp_clk_divider_ro_ops = { + .recalc_rate = zynqmp_clk_divider_recalc_rate, + .round_rate = zynqmp_clk_divider_round_rate, +}; + /** * zynqmp_clk_get_max_divisor() - Get maximum supported divisor from firmware. * @clk_id: Id of clock @@ -334,7 +339,10 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, return ERR_PTR(-ENOMEM); init.name = name; - init.ops = &zynqmp_clk_divider_ops; + if (nodes->type_flag & CLK_DIVIDER_READ_ONLY) + init.ops = &zynqmp_clk_divider_ro_ops; + else + init.ops = &zynqmp_clk_divider_ops; init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag);