linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFT V3 0/8] clk: make register endianness a run-time property
@ 2019-04-18 11:12 Jonas Gorski
  2019-04-18 11:12 ` [PATCH RFT V3 1/8] clk: divider: add explicit big endian support Jonas Gorski
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Jonas Gorski @ 2019-04-18 11:12 UTC (permalink / raw)
  To: linux-clk, linuxppc-dev, linux-arm-kernel, linux-rockchip, linux-tegra
  Cc: Peter De Schrijver, Fabio Estevam, Heiko Stuebner, Stephen Boyd,
	Michael Turquette, Michal Simek, Jonathan Hunter,
	Prashant Gaikwad, Paul Mackerras, NXP Linux Team,
	Pengutronix Kernel Team, Thierry Reding, Anatolij Gustschin,
	Shawn Guo, Sascha Hauer

Currently the endianness for register accesses of basic clocks if fixed
based on the architecture (BE for PowerPC, LE for everyone else). This
is inconvenient for architectures that support both.

To avoid adding more rules to the #ifdef, this patchset adds new flags
to the basic clocks to tag the registers as BE then converts the only
big endian machine PowerPC to use it.

While not used by PowerPC, also add big endian support to clk-fractional-
divider and clk-multiplier, to cover all basic clocks.
Technically clk-multiplier isn't one as it doesn't provide any
registration functions and none of its users set the basic clock flag,
but nevertheless it and its flags are defined clk-provider.h. So I think
it's close enough to a basic clock to still count.

That way we can drop the special casing for PowerPC, and allow other big
endian platforms/drivers to make use of the basic clocks.

In addition, we can now drop clk_readl and clk_writel, and replace them
with normal readl and writel accessors everywhere.

Still RFT because I don't have a PowerPC device to test, and especially
not a 512x one. I did compile test it though!

I looked really hard, and this is the only place I could find where a
PowerPC platform (indirectly) used the clk accessors.

None of the regular drivers in clk/ were selected in any of the powerpc
defconfigs, and this was the only platform code that registered basic
clocks.

Changelog:

V2 -> V3:
 * fix passed arguments to clk_div_readl found by kbuild
 * drop unneeded else in generic read accessors
 * fix a >80 chars line issue in the powerpc patch

V1 -> V2:
 * switch from global flag to per-clock flag
 * also added fractional divider and multiplier clocks, to make all
   basic or quasi basic clocks support big endian
 * reordered the basic clock patches in alphabetical order
 * drop clk_{readl,writel} instead of adding BE variants and use
   common accessors directly
 * dropped the RFC, as I got comments (yay). More always welcome of
   course :-)

Jonas Gorski (8):
  clk: divider: add explicit big endian support
  clk: fractional-divider: add explicit big endian support
  clk: gate: add explicit big endian support
  clk: multiplier: add explicit big endian support
  clk: mux: add explicit big endian support
  powerpc/512x: mark clocks as big endian
  clk: core: remove powerpc special handling
  clk: core: replace clk_{readl,writel} with {readl,writel}

 arch/powerpc/platforms/512x/clock-commonclk.c |  9 +++--
 drivers/clk/clk-divider.c                     | 26 +++++++++++---
 drivers/clk/clk-fractional-divider.c          | 22 ++++++++++--
 drivers/clk/clk-gate.c                        | 22 ++++++++++--
 drivers/clk/clk-multiplier.c                  | 22 ++++++++++--
 drivers/clk/clk-mux.c                         | 22 ++++++++++--
 drivers/clk/clk-xgene.c                       |  6 ++--
 drivers/clk/hisilicon/clk-hisi-phase.c        |  4 +--
 drivers/clk/imx/clk-divider-gate.c            | 20 +++++------
 drivers/clk/imx/clk-sccg-pll.c                | 12 +++----
 drivers/clk/nxp/clk-lpc18xx-ccu.c             |  6 ++--
 drivers/clk/nxp/clk-lpc18xx-cgu.c             | 24 ++++++-------
 drivers/clk/rockchip/clk-ddr.c                |  2 +-
 drivers/clk/rockchip/clk-half-divider.c       |  6 ++--
 drivers/clk/tegra/clk-tegra124.c              |  4 +--
 drivers/clk/tegra/clk-tegra210.c              |  6 ++--
 drivers/clk/zynq/clkc.c                       |  6 ++--
 drivers/clk/zynq/pll.c                        | 18 +++++-----
 include/linux/clk-provider.h                  | 51 +++++++++++----------------
 19 files changed, 181 insertions(+), 107 deletions(-)

-- 
2.13.2


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-04-23 17:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18 11:12 [PATCH RFT V3 0/8] clk: make register endianness a run-time property Jonas Gorski
2019-04-18 11:12 ` [PATCH RFT V3 1/8] clk: divider: add explicit big endian support Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-23  7:49   ` Geert Uytterhoeven
2019-04-23 10:39     ` Jonas Gorski
2019-04-23 17:40       ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 2/8] clk: fractional-divider: " Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 3/8] clk: gate: " Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 4/8] clk: multiplier: " Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 5/8] clk: mux: " Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 6/8] powerpc/512x: mark clocks as big endian Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 7/8] clk: core: remove powerpc special handling Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd
2019-04-18 11:12 ` [PATCH RFT V3 8/8] clk: core: replace clk_{readl, writel} with {readl, writel} Jonas Gorski
2019-04-18 21:51   ` Stephen Boyd

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).