From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 3E057C48BDF for ; Thu, 10 Jun 2021 20:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DDE06136D for ; Thu, 10 Jun 2021 20:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbhFJUMj (ORCPT ); Thu, 10 Jun 2021 16:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbhFJUMi (ORCPT ); Thu, 10 Jun 2021 16:12:38 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1D1C061574; Thu, 10 Jun 2021 13:10:29 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso7318473wmh.4; Thu, 10 Jun 2021 13:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lGhwbRzDJ+vGi7Ot+KWwVBsMmeXKl4MgFdcn1VLKhu4=; b=KK7Yi0BW7919kOgCjST7LGeMI5Ht7fQ6G+iTB444vZ3h9kTXMFwqhRJ9AyK0RKj5kO UIbwE9BedDIW0dGTtJUdQ0rQc1yyTgTNR/gyhrKdBCv85eitvYwj+Io4CUwTvp7IkSYi avcOSA/WAkWPtrwsXSXODeG0AquBbDSVfyVd+ImIcOQNBpfD2v6mD8T85Or5AYFL7qIt uQ++qYIIfxBcDV8iBfOr5MaDGL7bY5WqA/H1s4aoTrF4y2OzPuyU6aW7kKPiHmEhb+zn DhaXBAzFnjzM9Woj2r/y/hoXBF1XuFZ8QW20WzV1p9ZwGYLZ5uo3XlDdgJnAvQlmVXl2 2WaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lGhwbRzDJ+vGi7Ot+KWwVBsMmeXKl4MgFdcn1VLKhu4=; b=Op0L1cFPFsJsaxrYYvwOOH0wEoazBqq/jZ7e7Tk1Ajt40AGYH8lrMDjnnWTm9753AC YkpYJ841nHcUbNMVklOr5ff/FaQ7i8MTRncpX2+wd/LkUqw5bMNiYtvXxIRwEeGuSIOV xIX+wIfd9eatNZlAa7fdZ4wiKjoEGnH5YIAgRejH9KNBdrCpNRtED908viU7pIxBjEiF sM40RdDgl6x26NoyTzIdXFWWB8j2Yna58ADrmrAkuYvQUcFq5uv4uyJ+dsTcH4SPlobr F6xu5Nc+IzxTEiZ9+T7jofjoD4DM1vofAjHr+JhGVZ6RU8w5OT/Bt/PfDUDzX0W27XCT EtFA== X-Gm-Message-State: AOAM532Kuy/FhrAdYOiy6H94Atlj1Qchg86/c4hYp9SkGdbAAwBaFrcX YXGsa8BnI8pysKfExxgfC0Y0IzHo/NE= X-Google-Smtp-Source: ABdhPJwSbbI0f8rYfUdZeTHhH6+zg2pb5A+ySR5vIj18KhFz0KovyJaQYBG3DSUU4vvUaWKVC/kOLQ== X-Received: by 2002:a1c:c911:: with SMTP id f17mr592618wmb.60.1623355827750; Thu, 10 Jun 2021 13:10:27 -0700 (PDT) Received: from BV030612LT ([188.24.178.25]) by smtp.gmail.com with ESMTPSA id l13sm4883946wrz.34.2021.06.10.13.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 13:10:27 -0700 (PDT) Date: Thu, 10 Jun 2021 23:10:25 +0300 From: Cristian Ciocaltea To: Manivannan Sadhasivam Cc: Stephen Boyd , Rob Herring , Andreas =?iso-8859-1?Q?F=E4rber?= , Michael Turquette , Edgar Bernardi Righi , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 4/6] clk: actions: Fix AHPPREDIV-H-AHB clock chain on Owl S500 SoC Message-ID: <20210610201025.GA1497285@BV030612LT> References: <107776b4a4e752ef83b143114d2baf52bf8c4107.1622119892.git.cristian.ciocaltea@gmail.com> <20210610143413.GC315240@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210610143413.GC315240@thinkpad> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 08:04:13PM +0530, Manivannan Sadhasivam wrote: > On Thu, May 27, 2021 at 04:16:42PM +0300, Cristian Ciocaltea wrote: > > There are a few issues with the setup of the Actions Semi Owl S500 SoC's > > clock chain involving AHPPREDIV, H and AHB clocks: > > > > * AHBPREDIV clock is defined as a muxer only, although it also acts as > > a divider. > > * H clock is using a wrong divider register offset > > * AHB is defined as a multi-rate factor clock, but it is actually just > > a fixed pass clock. > > > > Let's provide the following fixes: > > > > * Change AHBPREDIV clock to an ungated OWL_COMP_DIV definition. > > * Use the correct register shift value in the OWL_DIVIDER definition > > for H clock > > * Drop the unneeded 'ahb_factor_table[]' and change AHB clock to an > > ungated OWL_COMP_FIXED_FACTOR definition. [...] > > /* composite clocks */ > > +static OWL_COMP_DIV(ahbprediv_clk, "ahbprediv_clk", ahbprediv_clk_mux_p, > > + OWL_MUX_HW(CMU_BUSCLK1, 8, 3), > > + { 0 }, > > + OWL_DIVIDER_HW(CMU_BUSCLK1, 12, 2, 0, NULL), > > + 0); > > + > > +static OWL_COMP_FIXED_FACTOR(ahb_clk, "ahb_clk", "h_clk", > > + { 0 }, > > + 1, 1, CLK_SET_RATE_PARENT); > > I think you swapped the flags between "ahbprediv_clk" and "ahb_clk"... Thanks for noticing this, I fixed it in v3: https://lore.kernel.org/lkml/cover.1623354574.git.cristian.ciocaltea@gmail.com/ > > + > > static OWL_COMP_FACTOR(vce_clk, "vce_clk", hde_clk_mux_p, > > OWL_MUX_HW(CMU_VCECLK, 4, 2), > > OWL_GATE_HW(CMU_DEVCLKEN0, 26, 0), > > -- > > 2.31.1 > > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 0F885C48BDF for ; Thu, 10 Jun 2021 20:12:15 +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 A66776139A for ; Thu, 10 Jun 2021 20:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A66776139A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jpGmWCbblBPA17KYrFRA2rHHIJ7Ao7nDI4iuQ3Z4frg=; b=gPJEnQS7Ui8MwW khVxXVhGllLHRGOe83hthQZQNIN0Xhmvu7ddJ7l++Op7d3dvJyKFXiSlJqYzmf/NoTOlEOFqXhap5 FJgIc/Do+85kDTHqFo0zEo0duqIxOafTHa9g/Oy/Wn9Fj1oZIPTssrPC5JdpVJUv+mQwNJVAj4NU+ hWnR5S7ognA0926Wy5AQylfMgNkndJYDh7f0C6/AUg1ogzdQ2cF/KX78MsBR5+VhazZPacJMU+4Xj 1PD34bogwzkja7O9tM0PdMpVOUawBZaLqlvrj6bFPq7J3/2+NDx+MSLKGPb7ZDnzEwsd1p5Gcp5ze eWCCMgkbIL8CVuQ7iKyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrR0e-002Med-CO; Thu, 10 Jun 2021 20:10:36 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrR0X-002Mbt-JB; Thu, 10 Jun 2021 20:10:31 +0000 Received: by mail-wm1-x329.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso5292846wmc.1; Thu, 10 Jun 2021 13:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lGhwbRzDJ+vGi7Ot+KWwVBsMmeXKl4MgFdcn1VLKhu4=; b=KK7Yi0BW7919kOgCjST7LGeMI5Ht7fQ6G+iTB444vZ3h9kTXMFwqhRJ9AyK0RKj5kO UIbwE9BedDIW0dGTtJUdQ0rQc1yyTgTNR/gyhrKdBCv85eitvYwj+Io4CUwTvp7IkSYi avcOSA/WAkWPtrwsXSXODeG0AquBbDSVfyVd+ImIcOQNBpfD2v6mD8T85Or5AYFL7qIt uQ++qYIIfxBcDV8iBfOr5MaDGL7bY5WqA/H1s4aoTrF4y2OzPuyU6aW7kKPiHmEhb+zn DhaXBAzFnjzM9Woj2r/y/hoXBF1XuFZ8QW20WzV1p9ZwGYLZ5uo3XlDdgJnAvQlmVXl2 2WaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lGhwbRzDJ+vGi7Ot+KWwVBsMmeXKl4MgFdcn1VLKhu4=; b=ZDJsO79r33BDo/U2cJhAmuiZjS0b3eSAnB5u5xRFgO/soOKgN2H9CA0ZHXqiAlLTeF ng8ADkHlaH3lamcIDAUJKN+7x6ma5PsDEy4R4TkCIOXit/8qB+vW8UdqaFDSv+CzAO/N CFPFX7pvzbAw1WVqTgbbf4dF6pJ5aDPZaidKB91Ev9bjbGMDTnpMP+PMOAWcS6MfGfVM zBbJm8+w9Iaxhb6OAC3F+Cxi0j7Gi4gzHgs6rxStISif5XfQUMfKPEIibPxIuKU0z68o 3kzN3nwrNDqN4hqDCkuhaLzvRMnfr/N4/gFoIBOdlOeFlo8VHzYgorM8ueH6vXSn3lf1 SGUw== X-Gm-Message-State: AOAM532w7xFdz0BGmlPlw/ej6aDTXi7T1qLkFYVn2oo6Vk4IRgF7c7CJ v7L4kuHZlFs0AZlnpcIr1SI= X-Google-Smtp-Source: ABdhPJwSbbI0f8rYfUdZeTHhH6+zg2pb5A+ySR5vIj18KhFz0KovyJaQYBG3DSUU4vvUaWKVC/kOLQ== X-Received: by 2002:a1c:c911:: with SMTP id f17mr592618wmb.60.1623355827750; Thu, 10 Jun 2021 13:10:27 -0700 (PDT) Received: from BV030612LT ([188.24.178.25]) by smtp.gmail.com with ESMTPSA id l13sm4883946wrz.34.2021.06.10.13.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 13:10:27 -0700 (PDT) Date: Thu, 10 Jun 2021 23:10:25 +0300 From: Cristian Ciocaltea To: Manivannan Sadhasivam Cc: Stephen Boyd , Rob Herring , Andreas =?iso-8859-1?Q?F=E4rber?= , Michael Turquette , Edgar Bernardi Righi , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 4/6] clk: actions: Fix AHPPREDIV-H-AHB clock chain on Owl S500 SoC Message-ID: <20210610201025.GA1497285@BV030612LT> References: <107776b4a4e752ef83b143114d2baf52bf8c4107.1622119892.git.cristian.ciocaltea@gmail.com> <20210610143413.GC315240@thinkpad> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210610143413.GC315240@thinkpad> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210610_131029_694972_2598F25C X-CRM114-Status: GOOD ( 18.01 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 10, 2021 at 08:04:13PM +0530, Manivannan Sadhasivam wrote: > On Thu, May 27, 2021 at 04:16:42PM +0300, Cristian Ciocaltea wrote: > > There are a few issues with the setup of the Actions Semi Owl S500 SoC's > > clock chain involving AHPPREDIV, H and AHB clocks: > > > > * AHBPREDIV clock is defined as a muxer only, although it also acts as > > a divider. > > * H clock is using a wrong divider register offset > > * AHB is defined as a multi-rate factor clock, but it is actually just > > a fixed pass clock. > > > > Let's provide the following fixes: > > > > * Change AHBPREDIV clock to an ungated OWL_COMP_DIV definition. > > * Use the correct register shift value in the OWL_DIVIDER definition > > for H clock > > * Drop the unneeded 'ahb_factor_table[]' and change AHB clock to an > > ungated OWL_COMP_FIXED_FACTOR definition. [...] > > /* composite clocks */ > > +static OWL_COMP_DIV(ahbprediv_clk, "ahbprediv_clk", ahbprediv_clk_mux_p, > > + OWL_MUX_HW(CMU_BUSCLK1, 8, 3), > > + { 0 }, > > + OWL_DIVIDER_HW(CMU_BUSCLK1, 12, 2, 0, NULL), > > + 0); > > + > > +static OWL_COMP_FIXED_FACTOR(ahb_clk, "ahb_clk", "h_clk", > > + { 0 }, > > + 1, 1, CLK_SET_RATE_PARENT); > > I think you swapped the flags between "ahbprediv_clk" and "ahb_clk"... Thanks for noticing this, I fixed it in v3: https://lore.kernel.org/lkml/cover.1623354574.git.cristian.ciocaltea@gmail.com/ > > + > > static OWL_COMP_FACTOR(vce_clk, "vce_clk", hde_clk_mux_p, > > OWL_MUX_HW(CMU_VCECLK, 4, 2), > > OWL_GATE_HW(CMU_DEVCLKEN0, 26, 0), > > -- > > 2.31.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel