linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Douglas Anderson <dianders@chromium.org>
Cc: Jonas Karlman <jonas@kwiboo.se>, Tomasz Figa <tfiga@chromium.org>,
	Randy Li <ayaka@soulik.info>, Ziyuan Xu <xzy.xu@rock-chips.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	ryandcase@chromium.org, Elaine Zhang <zhangqing@rock-chips.com>,
	mka@chromium.org, Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] clk: rockchip: Fix video codec clocks on rk3288
Date: Fri, 12 Apr 2019 13:22:31 +0200	[thread overview]
Message-ID: <7155822.nnOPNdQpWs@diego> (raw)
In-Reply-To: <20190411135555.235625-1-dianders@chromium.org>

Am Donnerstag, 11. April 2019, 15:55:55 CEST schrieb Douglas Anderson:
> It appears that there is a typo in the rk3288 TRM.  For
> GRF_SOC_CON0[7] it says that 0 means "vepu" and 1 means "vdpu".  It's
> the other way around.
> 
> How do I know?  Here's my evidence:
> 
> 1. Prior to commit 4d3e84f99628 ("clk: rockchip: describe aclk_vcodec
>    using the new muxgrf type on rk3288") we always pretended that we
>    were using "aclk_vdpu" and the comment in the code said that this
>    matched the default setting in the system.  In fact the default
>    setting is 0 according to the TRM and according to reading memory
>    at bootup.  In addition rk3288-based Chromebooks ran like this and
>    the video codecs worked.
> 2. With the existing clock code if you boot up and try to enable the
>    new VIDEO_ROCKCHIP_VPU as a module (and without "clk_ignore_unused"
>    on the command line), you get errors like "failed to get ack on
>    domain 'pd_video', val=0x80208".  After flipping vepu/vdpu things
>    init OK.
> 3. If I export and add both the vepu and vdpu to the list of clocks
>    for RK3288_PD_VIDEO I can get past the power domain errors, but now
>    I freeze when the vpu_mmu gets initted.
> 4. If I just mark the "vdpu" as IGNORE_UNUSED then everything boots up
>    and probes OK showing that somehow the "vdpu" was important to keep
>    enabled.  This is because we were actually using it as a parent.
> 5. After this change I can hack "aclk_vcodec_pre" to parent from
>    "aclk_vepu" using assigned-clocks and the video codec still probes
>    OK.
> 6. Rockchip has said so on the mailing list [1].
> 
> ...so let's fix it.
> 
> Let's also add CLK_SET_RATE_PARENT to "aclk_vcodec_pre" as suggested
> by Jonas Karlman.  Prior to the same commit you could do
> clk_set_rate() on "aclk_vcodec" and it would change "aclk_vdpu".
> That's because "aclk_vcodec" was a simple gate clock (always gets
> CLK_SET_RATE_PARENT) and its direct parent was "aclk_vdpu".  After
> that commit "aclk_vcodec_pre" gets in the way so we need to add
> CLK_SET_RATE_PARENT to it too.
> 
> [1] https://lkml.kernel.org/r/1d17b015-9e17-34b9-baf8-c285dc1957aa@rock-chips.com
> 
> Fixes: 4d3e84f99628 ("clk: rockchip: describe aclk_vcodec using the new muxgrf type on rk3288")
> Suggested-by: Jonas Karlman <jonas@kwiboo.se>
> Suggested-by: Randy Li <ayaka@soulik.info>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

applied for 5.2

Thanks
Heiko



      reply	other threads:[~2019-04-12 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 13:55 Douglas Anderson
2019-04-12 11:22 ` Heiko Stübner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7155822.nnOPNdQpWs@diego \
    --to=heiko@sntech.de \
    --cc=ayaka@soulik.info \
    --cc=dianders@chromium.org \
    --cc=ezequiel@collabora.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mka@chromium.org \
    --cc=mturquette@baylibre.com \
    --cc=ryandcase@chromium.org \
    --cc=sboyd@kernel.org \
    --cc=tfiga@chromium.org \
    --cc=xzy.xu@rock-chips.com \
    --cc=zhangqing@rock-chips.com \
    --subject='Re: [PATCH v2] clk: rockchip: Fix video codec clocks on rk3288' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox