Skip to content

phy: rockchip-usb: correct pll handling and usb-uart

Heiko Stuebner linux-arm-kernel linux-clk linux-rockchip lkml 3 versions – Applied

Status from this message: applied to my dts32 branch for 4.6 with Mike's Review-tag from v1

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 15 repliesApplied
  2. v28 patches 11 repliesSuperseded
  3. v18 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- rebase on top of Julias of_node_put fix
- address comments from Kishon Vijay Abraham
- position of the devm_action in the first patch
- separate compatible-addition into separate patch
- don't rephrase comment when moving stuff around
- address Doug's comment and keep clk-tree change and assigned-clocks setting together
- add Doug's review-tag to patches 5,6,7

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8phy: rockchip-usb: fix clock get-put mismatchdrivers/phy/phy-rockchip-usb.c+12 -00 replies
2/8phy: rockchip-usb: introduce a common data-struct for the devicedrivers/phy/phy-rockchip-usb.c+19 -71 reply
3/8phy: rockchip-usb: move per-phy init into a separate functiondrivers/phy/phy-rockchip-usb.c+43 -400 replies
4/8phy: rockchip-usb: add compatible values for rk3066a and rk3188Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt drivers/phy/phy-rockchip-usb.c+6 -15 replies
5/8phy: rockchip-usb: expose the phy-internal PLLsDocumentation/devicetree/bindings/phy/rockchip-usb-phy.txt drivers/phy/phy-rockchip-usb.c+162 -272 replies
6/8ARM: dts: rockchip: add clock-cells for usb phy nodesarch/arm/boot/dts/rk3066a.dtsi arch/arm/boot/dts/rk3188.dtsi arch/arm/boot/dts/rk3288.dtsi+7 -01 reply
7/8clk: rockchip: fix usbphy-related clocksarch/arm/boot/dts/rk3288-veyron.dtsi drivers/clk/rockchip/clk-rk3188.c drivers/clk/rockchip/clk-rk3288.c+9 -204 replies
8/8phy: rockchip-usb: add handler for usb-uart functionalityDocumentation/kernel-parameters.txt drivers/phy/phy-rockchip-usb.c+201 -360 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchDouglas AndersonMichael Turquette
1/8R-b
2/8R-b
3/8R-b
4/8
5/8R-b A-b
6/8R-b
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] phy: rockchip-usb: correct pll handling and usb-uart

changes in v3:
- rebase on top of Julias of_node_put fix
- address comments from Kishon Vijay Abraham
- position of the devm_action in the first patch
- separate compatible-addition into separate patch
- don't rephrase comment when moving stuff around
- address Doug's comment and keep clk-tree change and assigned-clocks setting together
- add Doug's review-tag to patches 5,6,7
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

Patch 1 might be nice to go in as fix together with Julia's patch?

Patches 2-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: add compatible values for rk3066a and rk3188
phy: rockchip-usb: expose the phy-internal PLLs
ARM: dts: rockchip: add clock-cells for usb phy nodes
clk: rockchip: fix usbphy-related clocks
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                     | 458 ++++++++++++++++++---
 9 files changed, 417 insertions(+), 89 deletions(-)
Signature · 1 line
2.6.2