Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3321909ybc; Thu, 21 Nov 2019 06:43:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzSPVp4hYqnG6jBbMj3hoUYmO5iWL9gSFZWOIHwyLK46e7XbEZERugv39C0DVoJRTYoE+Oo X-Received: by 2002:a17:906:b310:: with SMTP id n16mr14210819ejz.129.1574347413172; Thu, 21 Nov 2019 06:43:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574347413; cv=none; d=google.com; s=arc-20160816; b=XQj2bsPyPSPUVbri4lvmVTm/yuqB8SuG/9Za8+T74jKGc5s9Wr/Agg/Rfu4ZLzT+XK cRps2JNnOq4gfW3QzLT6hHGWH7tPhzmTUfyqkqsMXu5RF2jSB53XMZWOOah0oZIJU+o2 iY3i2CUsfd4K/fQJsk/xGx47FQDPT98JWaElUsag78XAK5flzPaQyCypQhO9zFLatDpM 5qOpYgsFrCieOFmsI3VRf8x7Al1FtSEyNws1hOxIAKbd6EKm2GF9ladqYVjPLCtEkL+5 rBLTdQyYMr2IgejnIhvIh7eytG0lB65iQi0aH3MFJYsxElDlK6drEECAM70M2gAHFp/L Enag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Lr2Q23vkad7qB9jnf7ZaKx8/SN7qTuEdrHwvKfCdR1s=; b=g34U/gPfeHJkhjML8XW+lEy55NovEoH1vZdWyA6x7rb2yZZDtQ13Jzp/bboH0MgKwN kvbzJVM/sZGCqmDRCqdM/FyhRfacOfZ81874VtJxigTcQXrcLkZ2tPReYqzWOyUyfcwo du5oO+nyP+fDGPnW8sZn0L5LFEy6RbhcnJAhDwmK095C2Mubqw63smL+yjl0oabUlj3y 6wgw+kTqpMJZ9Dma41QZWxOZagFm6q0x8Ovv4k0FhawMuF5AeP7v77R//cgBsJn/mpjl E+kFtiNND7LCh9XaEvGn+eTj7bF8s9xtAraXD5u99RVvTIRXN1ysnv9MAMfjjrdBndxZ n9ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z17si1883679ejp.141.2019.11.21.06.43.09; Thu, 21 Nov 2019 06:43:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbfKUOl5 (ORCPT + 99 others); Thu, 21 Nov 2019 09:41:57 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:34317 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfKUOl4 (ORCPT ); Thu, 21 Nov 2019 09:41:56 -0500 Received: from litschi.hi.pengutronix.de ([2001:67c:670:100:feaa:14ff:fe6a:8db5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iXneJ-000425-JC; Thu, 21 Nov 2019 15:41:35 +0100 Date: Thu, 21 Nov 2019 15:41:34 +0100 From: Michael Tretter To: Rajan Vaja Cc: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, dan.carpenter@oracle.com, gustavo@embeddedor.com, tejas.patel@xilinx.com, nava.manne@xilinx.com, ravi.patel@xilinx.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, m.tretter@pengutronix.de Subject: Re: [PATCH 7/7] clk: zynqmp: Fix fractional clock check Message-ID: <20191121154134.404304c9@litschi.hi.pengutronix.de> In-Reply-To: <1573564580-9006-8-git-send-email-rajan.vaja@xilinx.com> References: <1573564580-9006-1-git-send-email-rajan.vaja@xilinx.com> <1573564580-9006-8-git-send-email-rajan.vaja@xilinx.com> Organization: Pengutronix X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:feaa:14ff:fe6a:8db5 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Nov 2019 05:16:20 -0800, Rajan Vaja wrote: > Firmware driver sets BIT(4) to BIT(7) as custom type flags. To make > divider as fractional divider firmware sets BIT(4). So add support > for custom type flag and use BIT(4) of custom type flag as CLOCK_FRAC > bit. > > Add a new field to the clock_topology to store custom type flags. > > Signed-off-by: Rajan Vaja > --- > drivers/clk/zynqmp/clk-zynqmp.h | 1 + > drivers/clk/zynqmp/clkc.c | 4 ++++ > drivers/clk/zynqmp/divider.c | 7 +++---- > 3 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h > index fec9a15..5beeb41 100644 > --- a/drivers/clk/zynqmp/clk-zynqmp.h > +++ b/drivers/clk/zynqmp/clk-zynqmp.h > @@ -30,6 +30,7 @@ struct clock_topology { > u32 type; > u32 flag; > u32 type_flag; > + u8 custom_type_flag; > }; > > struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, > diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c > index 10e89f2..4dd8413 100644 > --- a/drivers/clk/zynqmp/clkc.c > +++ b/drivers/clk/zynqmp/clkc.c > @@ -84,6 +84,7 @@ struct name_resp { > > struct topology_resp { > #define CLK_TOPOLOGY_TYPE GENMASK(3, 0) > +#define CLK_TOPOLOGY_CUSTOM_TYPE_FLAGS GENMASK(7, 4) > #define CLK_TOPOLOGY_FLAGS GENMASK(23, 8) > #define CLK_TOPOLOGY_TYPE_FLAGS GENMASK(31, 24) > u32 topology[CLK_GET_TOPOLOGY_RESP_WORDS]; > @@ -396,6 +397,9 @@ static int __zynqmp_clock_get_topology(struct clock_topology *topology, > topology[*nnodes].type_flag = > FIELD_GET(CLK_TOPOLOGY_TYPE_FLAGS, > response->topology[i]); > + topology[*nnodes].custom_type_flag = > + FIELD_GET(CLK_TOPOLOGY_CUSTOM_TYPE_FLAGS, > + response->topology[i]); > (*nnodes)++; > } > > diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c > index 67aa88c..e700504 100644 > --- a/drivers/clk/zynqmp/divider.c > +++ b/drivers/clk/zynqmp/divider.c > @@ -25,7 +25,7 @@ > #define to_zynqmp_clk_divider(_hw) \ > container_of(_hw, struct zynqmp_clk_divider, hw) > > -#define CLK_FRAC BIT(13) /* has a fractional parent */ > +#define CLK_FRAC BIT(4) /* has a fractional parent */ Still NACK. This breaks the compatibility with the mainline TF-A. The bit is now a different from the bit than in the previous version of that patch. Moving the flag to custom_type_flags is fine, but please make sure that you stay backwards compatible to existing versions of the TF-A. Michael > > /** > * struct zynqmp_clk_divider - adjustable divider clock > @@ -279,13 +279,12 @@ 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 = nodes->flag; > init.parent_names = parents; > init.num_parents = 1; > > /* struct clk_divider assignments */ > - div->is_frac = !!(nodes->flag & CLK_FRAC); > + div->is_frac = !!(nodes->custom_type_flag & CLK_FRAC); > div->flags = nodes->type_flag; > div->hw.init = &init; > div->clk_id = clk_id;