linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC/RFT 0/6] clk: make register endianness a run-time property
@ 2019-04-08 10:20 Jonas Gorski
  2019-04-08 10:20 ` [PATCH RFC/RFT 1/6] clk: core: add support for generic big endian accesses Jonas Gorski
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Jonas Gorski @ 2019-04-08 10:20 UTC (permalink / raw)
  To: linux-clk, linuxppc-dev
  Cc: Stephen Boyd, Michael Turquette, Paul Mackerras,
	Anatolij Gustschin

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 a new
generic flag to tag the registers as BE and makes the basic clocks
follow it, then converts the only PowerPC user to use it.

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

RFC because I am unsure if this should be common flag or a per-clock
flag.

Technically it's the wrong place for the former, but having a different
flag for each basic clock looks a bit messy IMHO. This could also lead
to easy mistakes by using the "wrong" basic clock's flag, then having no
or unexpected effects due to the next free flag bit different for each
basic clock. This might be avoidable by using a free bit common to all,
e.g. the highest bit of the flag fields.

I don't have any strong feelings one way or the other. I just used this
way because I needed to start somewhere ;-).

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.

Jonas Gorski (6):
  clk: core: add support for generic big endian accesses
  clk: gate: make endian-aware
  clk: divider: make endian aware
  clk: mux: make endian aware
  powerpc/512x: mark clocks as big endian
  clk: core: remove powerpc special handling

 arch/powerpc/platforms/512x/clock-commonclk.c | 13 ++++++-----
 drivers/clk/clk-divider.c                     |  8 +++----
 drivers/clk/clk-gate.c                        |  6 +++---
 drivers/clk/clk-mux.c                         |  6 +++---
 drivers/clk/clk.c                             |  1 +
 include/linux/clk-provider.h                  | 31 ++++++++++++++++++---------
 6 files changed, 40 insertions(+), 25 deletions(-)

-- 
2.13.2


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

end of thread, other threads:[~2019-04-08 20:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-08 10:20 [PATCH RFC/RFT 0/6] clk: make register endianness a run-time property Jonas Gorski
2019-04-08 10:20 ` [PATCH RFC/RFT 1/6] clk: core: add support for generic big endian accesses Jonas Gorski
2019-04-08 20:12   ` Stephen Boyd
2019-04-08 10:20 ` [PATCH RFC/RFT 2/6] clk: gate: make endian-aware Jonas Gorski
2019-04-08 10:20 ` [PATCH RFC/RFT 3/6] clk: divider: make endian aware Jonas Gorski
2019-04-08 10:20 ` [PATCH RFC/RFT 4/6] clk: mux: " Jonas Gorski
2019-04-08 10:20 ` [PATCH RFC/RFT 5/6] powerpc/512x: mark clocks as big endian Jonas Gorski
2019-04-08 10:20 ` [PATCH RFC/RFT 6/6] clk: core: remove powerpc special handling Jonas Gorski

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