Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3166976ybt; Mon, 29 Jun 2020 17:31:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjXdQlOShhbj/EQn0/YbE/ocVH2nu21zKsuLkeYYg5+bOVWx94LY9k7KcqbmkmIIsfDFJq X-Received: by 2002:a17:906:2e83:: with SMTP id o3mr12667941eji.261.1593477079170; Mon, 29 Jun 2020 17:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593477079; cv=pass; d=google.com; s=arc-20160816; b=SXJqaskZhqmbYSHaVBGdp4TV+q1ON2fxV60caklT/HReXfENkxJwbPbD/WNu+aGiLu Ji8QrKMGjtSPWsXzccxKKW+F9XVmHQSZG7rEiOTG8jbarWFm9uZAz1BLDrO/bjwvJAdB 49+3cRjz6GerM9502Z8oUJvI+E7ADQg7TQKNunl15AYsXEaQfuCc+oBdv1AUhE4IhY8Q OYj7AHD5ZUHGTrY13VBhi/oM410eHoKv8ivRa6veejK576UZyNE/pkPAAS74VEUriK1e gZjRgB4YGI1B4rifYl7e0fPve4YFGewhe21rwHMNoyXmVQOEN78c93P9gpAAeTjRkdjy CGMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wG2jO2bAZPk1XXO2WlZNTAz4gDvNsEiwH0Xh1g1WXQU=; b=cNVxZUnJ1ghc3BaAIKG9Kh46xUs3YpDoL4npPJU567DGLFLhj2VO/zyjIbZ6MZd0Y9 7ejkRkyc/F23wl4RITQbY0yXYzUwTUoNLqy0RPJ+nmiTXWt1a5aWSCLdl5MwfUEb8isA mnI2sZPehPl9kP0tLIi7uxjRW94x/FbUOiFPQj11OoIQsCjk685Vizc4I9/gk+IO9qkF P8f5DU5Hh+hqpbsPuzK9jQoNyi8Vbceq99NJOfaiMkfVQgazxC/yCQDxralnh+GlKonw 4vofSxoDdGvddhYqaOjNS3Q4lKPFQOdp1QIpPDfDUh5pPLeqzDqYfM8yapmX3cx7UrAY LyOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=XwOsYz8H; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp6si936018ejc.472.2020.06.29.17.30.55; Mon, 29 Jun 2020 17:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=XwOsYz8H; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728666AbgF3Aaa (ORCPT + 99 others); Mon, 29 Jun 2020 20:30:30 -0400 Received: from mail-eopbgr750051.outbound.protection.outlook.com ([40.107.75.51]:13892 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728420AbgF3AaZ (ORCPT ); Mon, 29 Jun 2020 20:30:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K2TLAQA4UObwcgICnVUCxVMk+SNFlh7H9DnY6H7CSi0Zhb1IbanFjOrUaUnrRu8Rl6+ATVTRZAve3Qmn4u27iqOeglTn1PE5oEMUiG1UVwwMGcanDkVrvXGtDnAIGsZqWZN0SFHI2FbIERJOw6XhoY7LXtX6eCUsL8fQjmMT4+7mrlBZh5kuM5hBsjKIXzjCUSJBDsKQ9Zi31bVbJ/1KQt4SfXch175SurZh6m/5E/vnOQf+HYzu/Lq/goHD2k5/M6T5KqHHL5zQ4SWkzGGyIN9GH82J0PQrEPpbH6zECYdB4ooz1hDXevf6lT20V9GZLD4sZHpJSob+BmS0OpAubw== 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=wG2jO2bAZPk1XXO2WlZNTAz4gDvNsEiwH0Xh1g1WXQU=; b=c0o276yDHNiCCyp59sFMKwmQoNJAco043vFvXuPiJk24IDfS8tkAunxJOuMaCFPNg8cRhqtfJqAJ8kDUn5NJOz0UgKUPvnDsR45mOO0mWRaD4N5lkm98tJiFAXchw412WzAixLBfJVHMUyRMVhoMUBMjM74ARLP2tpthjt235OAYzsD+VgVFEahEmTAPQnnjBhYfYazwvx5iXbifSdzgn8BIYYzrokjsR9ZCeiMrxi/0r/tA6cCkZQUxRA2WDOGH5KuAq3F51XflYWf08Lcm9yrlU+0BlbBk1Dvm8O/4vKSPH0+zIbt+MDKxF7YMtf4F6LDsexGnyQkSWt1E7IAwHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=baylibre.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass 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=wG2jO2bAZPk1XXO2WlZNTAz4gDvNsEiwH0Xh1g1WXQU=; b=XwOsYz8H/5XcQoxzEgR/5KCGi4uNKWd4PE79AVQWTXvdP+4yBzvATqlSsSpCif2xwyO3+nth9A/u6RwR0Ie0lzMuOF0IjkTDmomjeFPrk/zB0M3fOk+8YXSPvhyVTn+NRwJfgBK4DOvDNa1XbpdkNqs8zUX5bTZeJ6Uz7PcWVJs= Received: from BL0PR05CA0020.namprd05.prod.outlook.com (2603:10b6:208:91::30) by CY4PR02MB2502.namprd02.prod.outlook.com (2603:10b6:903:6a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Tue, 30 Jun 2020 00:30:20 +0000 Received: from BL2NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:208:91:cafe::5f) by BL0PR05CA0020.outlook.office365.com (2603:10b6:208:91::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.10 via Frontend Transport; Tue, 30 Jun 2020 00:30:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; baylibre.com; dkim=none (message not signed) header.d=none;baylibre.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT032.mail.protection.outlook.com (10.152.77.169) with Microsoft SMTP Server id 15.20.3131.20 via Frontend Transport; Tue, 30 Jun 2020 00:30:20 +0000 Received: from [149.199.38.66] (port=58555 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jq48w-00054q-4x; Mon, 29 Jun 2020 17:28:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jq4AF-0005bY-JU; Mon, 29 Jun 2020 17:30:19 -0700 Received: from [10.18.5.8] (helo=xsjamitsuni51.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jq4AC-0005YJ-6I; Mon, 29 Jun 2020 17:30:16 -0700 From: Amit Sunil Dhamne To: mturquette@baylibre.com, sboyd@codeaurora.org, sboyd@kernel.org, michal.simek@xilinx.com, mark.rutland@arm.com, linux-clk@vger.kernel.org Cc: rajanv@xilinx.com, jollys@xilinx.com, tejasp@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rajan Vaja , Amit Sunil Dhamne Subject: [PATCH 2/3] clk: zynqmp: Use firmware specific divider clock flags Date: Mon, 29 Jun 2020 17:30:13 -0700 Message-Id: <1593477014-18443-3-git-send-email-amit.sunil.dhamne@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593477014-18443-1-git-send-email-amit.sunil.dhamne@xilinx.com> References: <1593477014-18443-1-git-send-email-amit.sunil.dhamne@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapsmtpgw01;PTR:unknown-60-83.xilinx.com;CAT:NONE;SFTY:;SFS:(376002)(136003)(39860400002)(346002)(396003)(46966005)(426003)(186003)(70586007)(336012)(82740400003)(4326008)(36756003)(54906003)(8936002)(70206006)(9786002)(2906002)(107886003)(5660300002)(8676002)(82310400002)(83380400001)(2616005)(26005)(316002)(356005)(6666004)(478600001)(47076004)(7696005)(81166007);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 34a247de-dec1-474d-67b1-08d81c8cc512 X-MS-TrafficTypeDiagnostic: CY4PR02MB2502: X-Microsoft-Antispam-PRVS: Content-Transfer-Encoding: quoted-printable X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:597; X-Forefront-PRVS: 0450A714CB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SQFhAS7c7+f6d+tmk89nTkhcsjnpdgTwB37GWF1cFzEHeQZxqOfEs/8nJcH1pfYsMteGWJg/iqBBzxId5d+rItJjGU2o+NveeyI6jb4rIBT590ztHwIedPUMeZoEg4YN2UbYh1VjJormvce6cyqZRGR7/mlJA8taPYQqs9Buo6RYTVXjM03wqDamq+Al6gSSL57cfC2/qK7kADERnjdTg5XvwePhKVWlw/jndcPKwUlyfT8YE33hbKTDCS7I5+qDKnsVeKCcsA1biylEP1WrIv9bFetIBZGhg27Ke+j/CEg9onQ73XNVgraoqBewl1cVz0W2t/o/dEcUlKAN4khQvtCAYKcmmLog8IPtUEbt2sLjedjKBqfQrmbFjGseM/yHQ718MDn/GyyEYe2WAVsXbg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2020 00:30:20.0142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34a247de-dec1-474d-67b1-08d81c8cc512 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-AuthSource: BL2NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2502 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajan Vaja Use ZynqMP specific divider clock flags instead of using CCF flags. Signed-off-by: Rajan Vaja Signed-off-by: Amit Sunil Dhamne --- drivers/clk/zynqmp/clk-zynqmp.h | 9 +++++++++ drivers/clk/zynqmp/divider.c | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqm= p.h index d8e580b..ade5e9e 100644 --- a/drivers/clk/zynqmp/clk-zynqmp.h +++ b/drivers/clk/zynqmp/clk-zynqmp.h @@ -32,6 +32,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 66da02b..f15d6b7 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -319,7 +319,21 @@ struct clk_hw *zynqmp_clk_register_divider(const char = *name, /* struct clk_divider assignments */ div->is_frac =3D !!((nodes->flag & CLK_FRAC) | (nodes->custom_type_flag & CUSTOM_FLAG_CLK_FRAC))= ; - div->flags =3D nodes->type_flag; + div->flags =3D 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ONE_BASED) ? + CLK_DIVIDER_ONE_BASED : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO= ) ? + CLK_DIVIDER_POWER_OF_TWO : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ALLOW_ZERO) = ? + CLK_DIVIDER_ALLOW_ZERO : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO= ) ? + CLK_DIVIDER_HIWORD_MASK : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ROUND_CLOSES= T) ? + CLK_DIVIDER_ROUND_CLOSEST : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_READ_ONLY) ? + CLK_DIVIDER_READ_ONLY : 0; + div->flags |=3D (nodes->type_flag & ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO)= ? + CLK_DIVIDER_MAX_AT_ZERO : 0; div->hw.init =3D &init; div->clk_id =3D clk_id; div->div_type =3D nodes->type; -- 2.7.4 This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.