linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: heiko@sntech.de (Heiko Stuebner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/8] phy: rockchip-usb: correct pll handling and usb-uart
Date: Mon, 09 Nov 2015 22:27:06 +0100	[thread overview]
Message-ID: <3369052.6pxaYT98AY@phil> (raw)
In-Reply-To: <CAD=FV=UCQ7ESi8NiZubAwa9Zzo4uiZHqm96bVMEue=M+Th4pTA@mail.gmail.com>

Am Montag, 9. November 2015, 13:11:18 schrieb Doug Anderson:
> Heiko,
> 
> On Sun, Nov 8, 2015 at 8:04 AM, Heiko Stuebner <heiko@sntech.de> wrote:
> > changes in v2:
> > - add Doug's review-tag to patches 1 and 3
> > - address comment and add the missing transistional rk_phy->base
> >   assignment in patch2
> >
> >
> > Patches 1-7 fix a long-standing issue with the clock-tree of Rockchip SoCs
> > namely our ignorance of the usbphy-internal pll that creates the needed
> > 480MHz but is also a supply-clock back to the core clock-controller in
> > Rockchip SoCs.
> >
> > Till now that was worked around using a virtual clock in the cru itself,
> > but that is of course ignorant of other parts then disabling the phy
> > behind the cru's back, thus breaking potential users of these clocks.
> >
> >
> > Patch 8, while not associated with the new pll handling, also builds
> > on the groundwork introduced there and adds support for the function
> > repurposing one of the phys as passthrough for uart-data. This enables
> > attaching a ttl converter to the D+ and D- pins of an usb cable to
> > receive uart data this way, when it is not really possible to attach
> > a regular serial console to a board.
> >
> > One point of critique in my first iteration [0] of this was, that
> > due to when the reconfiguration happens we may miss parts of the logs
> > when earlycon is enabled. So far early_initcall gets used as the
> > unflattened devicetree is necessary to set this up. Doing this for
> > example in the early_param directly would require parsing the flattened
> > devicetree to get needed nodes and properties.
> >
> > I still maintain that if you're working on anything before smp-bringup
> > you should use a real dev-board instead or try to solder uart cables
> > on hopefully available test-points :-) .
> >
> >
> > In any case, if patch 8 causes to much headache, it could be dropped
> > to not hinder the earlier 7 patches.
> >
> > [0] http://comments.gmane.org/gmane.linux.ports.arm.rockchip/715
> >
> > Heiko Stuebner (8):
> >   phy: rockchip-usb: fix clock get-put mismatch
> >   phy: rockchip-usb: introduce a common data-struct for the device
> >   phy: rockchip-usb: move per-phy init into a separate function
> >   phy: rockchip-usb: expose the phy-internal PLLs
> >   clk: rockchip: fix usbphy-related clocks
> >   ARM: dts: rockchip: add clock-cells for usb phy nodes
> >   ARM: dts: rockchip: assign usbphy480m_src to the new usbphy pll on
> >     veyron
> >   phy: rockchip-usb: add handler for usb-uart functionality
> >
> >  .../devicetree/bindings/phy/rockchip-usb-phy.txt   |   6 +-
> >  Documentation/kernel-parameters.txt                |   6 +
> >  arch/arm/boot/dts/rk3066a.dtsi                     |   2 +
> >  arch/arm/boot/dts/rk3188.dtsi                      |   2 +
> >  arch/arm/boot/dts/rk3288-veyron.dtsi               |   2 +-
> >  arch/arm/boot/dts/rk3288.dtsi                      |   3 +
> >  drivers/clk/rockchip/clk-rk3188.c                  |  11 +-
> >  drivers/clk/rockchip/clk-rk3288.c                  |  16 +-
> >  drivers/phy/phy-rockchip-usb.c                     | 449 ++++++++++++++++++---
> >  9 files changed, 416 insertions(+), 81 deletions(-)
> 
> If you happened to be in the mood for cleaning up this PHY and wanted
> to fix up one more thing that I noticed...
> 
> ...you could actually increase the range of registers managed by the
> PHYs.  For instance, in rk3288, the "host1" port isn't just managed by
> 1 register, but by 4 (GRF_UOC2_CON0 - GRF_UOC2_CON3).  I think there
> are 5 for the OTG port.
> 
> Obviously not required for this series and there's no (current) reason
> to do anything with the rest of those registers, but it might be
> interesting for the future...

I'm not sure what change you're proposing :-) .

I currently see the reg-property both in the dts and in the code as
"offset" - the start-register, because it points to uoc_con0 for each phy.
So if needed I was just planning on doing reg+x , as they're coming from
the GRF anyway.

One interesting point would be to move that under the GRF node, similar
to what we're doing with the power-domains under the PMU.

In retrospect I think exposing the phys individually was not the best
decision - especially as when you dive deeper, they are not that similar
anymore and individual functions change. But we'll have to live with that.

That is by the way, also one of the reasons for having these per-phy
structs, so that we have the possility to identify phys again and describe
individual phy-functions but still keep the current binding.
The usb-uart is the first user for that :-)

Heiko

  reply	other threads:[~2015-11-09 21:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08 16:04 [PATCH v2 0/8] phy: rockchip-usb: correct pll handling and usb-uart Heiko Stuebner
2015-11-08 16:04 ` [PATCH v2 1/8] phy: rockchip-usb: fix clock get-put mismatch Heiko Stuebner
2015-11-08 16:04 ` [PATCH v2 2/8] phy: rockchip-usb: introduce a common data-struct for the device Heiko Stuebner
2015-11-08 16:04 ` [PATCH v2 3/8] phy: rockchip-usb: move per-phy init into a separate function Heiko Stuebner
2015-11-08 16:04 ` [PATCH v2 4/8] phy: rockchip-usb: expose the phy-internal PLLs Heiko Stuebner
2015-11-09 20:59   ` Doug Anderson
2015-11-09 21:08     ` Heiko Stuebner
2015-11-09 21:12       ` Doug Anderson
2015-11-08 16:04 ` [PATCH v2 5/8] clk: rockchip: fix usbphy-related clocks Heiko Stuebner
2015-11-09 21:01   ` Doug Anderson
2015-11-08 16:04 ` [PATCH v2 6/8] ARM: dts: rockchip: add clock-cells for usb phy nodes Heiko Stuebner
2015-11-09 21:01   ` Doug Anderson
2015-11-08 16:04 ` [PATCH v2 7/8] ARM: dts: rockchip: assign usbphy480m_src to the new usbphy pll on veyron Heiko Stuebner
2015-11-09 21:08   ` Doug Anderson
2015-11-09 22:08     ` Heiko Stuebner
2015-11-08 16:04 ` [PATCH v2 8/8] phy: rockchip-usb: add handler for usb-uart functionality Heiko Stuebner
2015-11-09 21:11 ` [PATCH v2 0/8] phy: rockchip-usb: correct pll handling and usb-uart Doug Anderson
2015-11-09 21:27   ` Heiko Stuebner [this message]
2015-11-09 21:32     ` Doug Anderson
2015-11-09 21:48       ` Heiko Stuebner

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=3369052.6pxaYT98AY@phil \
    --to=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).