LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: Adam Ford <aford173@gmail.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: linux-clk@vger.kernel.org,
	linux-devicetree <devicetree@vger.kernel.org>,
	arm-soc <linux-arm-kernel@lists.infradead.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Sekhar Nori <nsekhar@ti.com>,
	Kevin Hilman <khilman@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 00/42] ARM: davinci: convert to common clock framework​
Date: Mon, 19 Mar 2018 17:54:27 -0500	[thread overview]
Message-ID: <4dc2725d-0dee-1c7f-1e6d-9a93e6228826@lechnology.com> (raw)
In-Reply-To: <CAHCN7xLt6QqHodd=0HKXBxLjjn8ua5Re7NYW=sPeH+TmnXpkJQ@mail.gmail.com>

On 03/19/2018 12:52 PM, Adam Ford wrote:
> On Mon, Mar 19, 2018 at 11:15 AM, Bartosz Golaszewski
> <bgolaszewski@baylibre.com> wrote:
>> 2018-03-19 17:14 GMT+01:00 Bartosz Golaszewski <bgolaszewski@baylibre.com>:
>>> 2018-03-19 17:11 GMT+01:00 Adam Ford <aford173@gmail.com>:
>>>> On Mon, Mar 19, 2018 at 10:59 AM, David Lechner <david@lechnology.com> wrote:
>>>>> On 03/19/2018 08:17 AM, Bartosz Golaszewski wrote:
>>>>>>
>>>>>> 2018-03-16 3:52 GMT+01:00 David Lechner <david@lechnology.com>:
>>>>>>>
>>>>>>> This series converts mach-davinci to use the common clock framework.
>>>>>>>
>>>>>>> The series works like this, the first 19 patches create new clock drivers
>>>>>>> using the common clock framework. There are basically 3 groups of clocks
>>>>>>> -
>>>>>>> PLL, PSC and CFGCHIP (syscon). There are six different SoCs that each
>>>>>>> have
>>>>>>> unique init data, which is the reason for so many patches.
>>>>>>>
>>>>>>> Then, starting with "ARM: davinci: pass clock as parameter to
>>>>>>> davinci_timer_init()", we get the mach code ready for the switch by
>>>>>>> adding the
>>>>>>> code needed for the new clock drivers and adding #ifndef
>>>>>>> CONFIG_COMMON_CLK
>>>>>>> around the legacy clocks so that we can switch easily between the old and
>>>>>>> the
>>>>>>> new.
>>>>>>>
>>>>>>> "ARM: davinci: switch to common clock framework" actually flips the
>>>>>>> switch
>>>>>>> to start using the new clock drivers. Then the next 8 patches remove all
>>>>>>> of the old clock code.
>>>>>>>
>>>>>>> The final three patches add device tree clock support to the one SoC that
>>>>>>> supports it.
>>>>>>>
>>>>>>> This series has been tested on LEGO MINDSTORMS EV3 (device tree) and TI
>>>>>>> OMAP-L138 LCDK (both device tree and legacy board file).
>>>>>>>
> 
> 
> Does anyone have an LCD connected to the LCDC controller with device
> tree?  I posted an RFC patch a while ago for the DA850-EVM, but I got
> distracted and forgot about it, so I never working on getting the
> patch ready for acceptance.
> 
> I am trying to test the LCD now, but I cannot get the screen to come
> up, but in the process, it appears as if the clocking to the LCD isn't
> quite right.  I know it used to work, but I am going to probe some
> pins, but I am getting warning messages I have never received before.
> The desired clock frequency is 9000000, but when I use the cpufreq in
> ondemand mode, I get the following messages:
> 
> #  echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
> # tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: effective pixel clock rate (50000000Hz) differs from the
>   calculated rate (54000000Hz)
> tilcdc 1e13000.display: tilcdc_crtc_irq(0x00000161): FIFO underflow
> 
> As ondemend is used and the processor scaling happens, the above
> message appears on and off.
> 
> I do not know if it impacts the LCD image since I haven't been able to
> get it working yet, but I'll troubleshoot it and when/if I can get the
> LCD working, I'll turn on the ondemand again and see how it behaves.
> 
> adam
> 
> 

I've just been using the VGA connector on the LCDK since that is the only
hardware I have that uses the LCDC controller and I haven't tried it with
ondemand CPU freq yet.

But, I do know this. The parent clock for the LCDC (PLL0 SYSCLK2) must be
(according to the TRM) set to a fixed ratio to the ARM clock (/2), so it
can only have certain rates. The tilcdc driver then tries to pick a
divider for that rate to get close enough to the requested 54MHz. Also,
this divider must be at least 2. It can't be 1 (or 0).

So, if the CPU throttles down to 100, 200, or 300MHz, then 50Mz is as
close as any integer divider can get. The kernel prints a warning if
the difference between the requested and actual rate is over 5%. There
is a note in the kernel comments that this 5% value is arbitrary, so
maybe it needs to change to 10%?

I haven't dug deep enough to understand why the driver thinks it needs
a 54MHz pixel when you think it should be 9MHz.

I am also occasionally seeing the underflow error when the CPU is busy.
Maybe there is some more tweaking that could be done with the master
priority controller (unrelated to this patch series)? Or maybe if you
want to use the LCDC, then you just need to run at 475MHz all of the
time?

  reply	other threads:[~2018-03-19 22:54 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16  2:52 David Lechner
2018-03-16  2:52 ` [PATCH v8 01/42] dt-bindings: clock: Add new bindings for TI Davinci PLL clocks David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 02/42] clk: davinci: New driver for davinci " David Lechner
2018-03-20 16:56   ` Stephen Boyd
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 03/42] clk: davinci: Add platform information for TI DA830 PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 04/42] clk: davinci: Add platform information for TI DA850 PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 05/42] clk: davinci: Add platform information for TI DM355 PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 06/42] clk: davinci: Add platform information for TI DM365 PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 07/42] clk: davinci: Add platform information for TI DM644x PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 08/42] clk: davinci: Add platform information for TI DM646x PLL David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 09/42] dt-bindings: clock: New bindings for TI Davinci PSC David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 10/42] clk: davinci: New driver for davinci PSC clocks David Lechner
2018-03-20 17:03   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 11/42] clk: davinci: Add platform information for TI DA830 PSC David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 12/42] clk: davinci: Add platform information for TI DA850 PSC David Lechner
2018-03-16  3:11   ` David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 13/42] clk: davinci: Add platform information for TI DM355 PSC David Lechner
2018-03-20 16:58   ` Stephen Boyd
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 14/42] clk: davinci: Add platform information for TI DM365 PSC David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 15/42] clk: davinci: Add platform information for TI DM644x PSC David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 16/42] clk: davinci: Add platform information for TI DM646x PSC David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 17/42] dt-bindings: clock: Add bindings for DA8XX CFGCHIP clocks David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 18/42] clk: davinci: New driver for TI " David Lechner
2018-03-20 16:54   ` Stephen Boyd
2018-03-20 16:57     ` David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 19/42] clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks David Lechner
2018-03-20 17:04   ` Stephen Boyd
2018-03-16  2:52 ` [PATCH v8 20/42] ARM: davinci: pass clock as parameter to davinci_timer_init() David Lechner
2018-04-05 12:12   ` Sekhar Nori
2018-03-16  2:52 ` [PATCH v8 21/42] ARM: davinci: da830: add new clock init using common clock framework David Lechner
2018-03-16  2:52 ` [PATCH v8 22/42] ARM: davinci: da850: " David Lechner
2018-03-16  2:52 ` [PATCH v8 23/42] ARM: davinci: dm355: " David Lechner
2018-03-16  2:52 ` [PATCH v8 24/42] ARM: davinci: dm365: " David Lechner
2018-03-16  2:52 ` [PATCH v8 25/42] ARM: davinci: dm644x: " David Lechner
2018-04-03 10:26   ` Sekhar Nori
2018-04-03 16:30     ` David Lechner
2018-04-04  6:47       ` Sekhar Nori
2018-04-04 12:44         ` Sekhar Nori
2018-04-04 16:21     ` David Lechner
2018-03-16  2:52 ` [PATCH v8 26/42] ARM: davinci: dm646x: " David Lechner
2018-03-16  2:52 ` [PATCH v8 27/42] ARM: davinci: da8xx: add new USB PHY " David Lechner
2018-03-16  2:52 ` [PATCH v8 28/42] ARM: davinci: da8xx: add new sata_refclk " David Lechner
2018-03-16  2:52 ` [PATCH v8 29/42] ARM: davinci: remove CONFIG_DAVINCI_RESET_CLOCKS David Lechner
2018-03-16  2:52 ` [PATCH v8 30/42] ARM: davinci_all_defconfig: " David Lechner
2018-03-16  2:52 ` [PATCH v8 31/42] ARM: davinci: switch to common clock framework David Lechner
2018-03-16  2:52 ` [PATCH v8 32/42] ARM: davinci: da830: Remove legacy clock init David Lechner
2018-03-16  2:52 ` [PATCH v8 33/42] ARM: davinci: da850: " David Lechner
2018-03-16  2:52 ` [PATCH v8 34/42] ARM: davinci: dm355: " David Lechner
2018-03-16  2:52 ` [PATCH v8 35/42] ARM: davinci: dm365: " David Lechner
2018-03-16  2:52 ` [PATCH v8 36/42] ARM: davinci: dm644x: " David Lechner
2018-03-16  2:52 ` [PATCH v8 37/42] ARM: davinci: dm646x: " David Lechner
2018-03-16  2:52 ` [PATCH v8 38/42] ARM: davinci: da8xx: Remove legacy USB and SATA " David Lechner
2018-03-16  2:52 ` [PATCH v8 39/42] ARM: davinci: remove legacy clocks David Lechner
2018-03-16  2:52 ` [PATCH v8 40/42] ARM: davinci: add device tree support to timer David Lechner
2018-04-05 11:30   ` Sekhar Nori
2018-03-16  2:52 ` [PATCH v8 41/42] ARM: davinci: da8xx-dt: switch to device tree clocks David Lechner
2018-03-16  2:52 ` [PATCH v8 42/42] ARM: dts: da850: Add clocks David Lechner
2018-03-16 17:20   ` David Lechner
2018-04-02 11:12     ` Sekhar Nori
2018-04-02 16:15       ` David Lechner
2018-04-03  5:43         ` Sekhar Nori
2018-03-16  2:59 ` [PATCH v8 00/42] ARM: davinci: convert to common clock framework​ David Lechner
2018-03-19 13:17 ` Bartosz Golaszewski
2018-03-19 15:59   ` David Lechner
2018-03-19 16:11     ` Adam Ford
2018-03-19 16:14       ` Bartosz Golaszewski
2018-03-19 16:15         ` Bartosz Golaszewski
2018-03-19 17:52           ` Adam Ford
2018-03-19 22:54             ` David Lechner [this message]
2018-03-19 22:14       ` David Lechner
2018-03-20  0:53 ` Stephen Boyd
2018-03-20 13:52   ` Sekhar Nori

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=4dc2725d-0dee-1c7f-1e6d-9a93e6228826@lechnology.com \
    --to=david@lechnology.com \
    --cc=aford173@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=nsekhar@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --subject='Re: [PATCH v8 00/42] ARM: davinci: convert to common clock framework​' \
    /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
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).