From: Jerome Brunet <jbrunet@baylibre.com> To: Neil Armstrong <narmstrong@baylibre.com>, Kevin Hilman <khilman@baylibre.com> Cc: Jerome Brunet <jbrunet@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Michael Turquette <mturquette@baylibre.com>, Carlo Caione <carlo@caione.org>, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/19] clk: meson: use regmap in clock controllers Date: Wed, 31 Jan 2018 19:09:26 +0100 [thread overview] Message-ID: <20180131180945.18025-1-jbrunet@baylibre.com> (raw) This changeset is a rework of meson's clock controllers to use regmap instead of directly using io memory. It based clk-meson next/drivers and depends on few core clock patches, mainly to export generic clocks helpers: [0],[1]. The line count is pretty high but the changes are actually fairly simple and repetitive. This work has been triggered by the fact that the HHI register space on gxbb and axg provides more than just clocks. The display driver already uses a syscon for HHI on gxbb. This is why gxbb did not use devm_ioremap_resource() to map the registers, since it would have reserved the memory region, preventing another driver from re-mapping it. The cleaner solution is, of course, to use syscon to handle. The purpose of this changeset is to allow it. Even if meson8b does not need this ATM, there is real reason to leave it behind. It is actually easier to migrate it as well, so all meson clock drivers may support regmap only. The rework starts with a few easy clean-ups. The real deal starts with patch 5, which adds meson's clk_regmap. This will be used as common structure to implement all the controller clocks. Having this replaces the gxbb AO controller specific regmap gate. This structure will also be re-used in upcoming controllers, such as the axg's AO and audio controllers. Each clock type is then migrated, one at a time, to this new structure. While at it, the meson clock drivers have been cleaned-up a bit, removing the gate embedded in the mpll driver, simplifying the pll driver and removing the legacy cpu_clk of meson8b The new code around the cpu clk of the meson8b is just re-implementation, using simple elements, of the old cpu_clk. What was failing before is still expected to fail now. Apparently this clock will need a bit more love to enable dvfs on meson8b. BTW, thanks a lot to Martin for trying this rework as early as he did !! With this series applied, the clock controllers of the gxbb, gxl and axg SoC will try get regmap from their parent DT node. If this fails, they will fallback to mapping the register themselves. This fallback will be kept until platform DTs have changed so clock controllers is a child of the HHI system controller. Based on this changeset, more patches are coming. For those interested, the WIP is available here [2] [0]: https://lkml.kernel.org/r/20180118110144.30619-1-jbrunet@baylibre.com [1]: https://lkml.kernel.org/r/20180122105759.12206-1-jbrunet@baylibre.com [2]: https://github.com/jeromebrunet/linux/tree/v4.16/meson/clk-regmap Jerome Brunet (19): clk: meson: use dev pointer where possible clk: meson: use devm_of_clk_add_hw_provider clk: meson: only one loop index is necessary in probe clk: meson: remove obsolete comments clk: meson: add regmap clocks clk: meson: switch gxbb ao_clk to clk_regmap clk: meson: remove superseded aoclk_gate_regmap clk: meson: add regmap to the clock controllers clk: meson: migrate gates to clk_regmap clk: meson: migrate dividers to clk_regmap clk: meson: migrate muxes to clk_regmap clk: meson: add regmap helpers for parm clk: meson: migrate mplls clocks to clk_regmap clk: meson: migrate the audio divider clock to clk_regmap clk: meson: migrate plls clocks to clk_regmap clk: meson: split divider and gate part of mpll clk: meson: rework meson8b cpu clock clk: meson: remove obsolete cpu_clk clk: meson: use hhi syscon if available drivers/clk/meson/Kconfig | 9 + drivers/clk/meson/Makefile | 5 +- drivers/clk/meson/axg.c | 722 +++++++++-------- drivers/clk/meson/axg.h | 6 +- drivers/clk/meson/clk-audio-divider.c | 63 +- drivers/clk/meson/clk-cpu.c | 178 ----- drivers/clk/meson/clk-mpll.c | 132 +--- drivers/clk/meson/clk-pll.c | 243 +++--- drivers/clk/meson/clk-regmap.c | 166 ++++ drivers/clk/meson/clk-regmap.h | 111 +++ drivers/clk/meson/clkc.h | 93 +-- drivers/clk/meson/gxbb-aoclk-regmap.c | 46 -- drivers/clk/meson/gxbb-aoclk.c | 20 +- drivers/clk/meson/gxbb-aoclk.h | 11 - drivers/clk/meson/gxbb.c | 1399 ++++++++++++++++++--------------- drivers/clk/meson/gxbb.h | 5 +- drivers/clk/meson/meson8b.c | 612 ++++++++------ drivers/clk/meson/meson8b.h | 11 +- 18 files changed, 2016 insertions(+), 1816 deletions(-) delete mode 100644 drivers/clk/meson/clk-cpu.c create mode 100644 drivers/clk/meson/clk-regmap.c create mode 100644 drivers/clk/meson/clk-regmap.h delete mode 100644 drivers/clk/meson/gxbb-aoclk-regmap.c -- 2.14.3
WARNING: multiple messages have this Message-ID (diff)
From: jbrunet@baylibre.com (Jerome Brunet) To: linus-amlogic@lists.infradead.org Subject: [PATCH 00/19] clk: meson: use regmap in clock controllers Date: Wed, 31 Jan 2018 19:09:26 +0100 [thread overview] Message-ID: <20180131180945.18025-1-jbrunet@baylibre.com> (raw) This changeset is a rework of meson's clock controllers to use regmap instead of directly using io memory. It based clk-meson next/drivers and depends on few core clock patches, mainly to export generic clocks helpers: [0],[1]. The line count is pretty high but the changes are actually fairly simple and repetitive. This work has been triggered by the fact that the HHI register space on gxbb and axg provides more than just clocks. The display driver already uses a syscon for HHI on gxbb. This is why gxbb did not use devm_ioremap_resource() to map the registers, since it would have reserved the memory region, preventing another driver from re-mapping it. The cleaner solution is, of course, to use syscon to handle. The purpose of this changeset is to allow it. Even if meson8b does not need this ATM, there is real reason to leave it behind. It is actually easier to migrate it as well, so all meson clock drivers may support regmap only. The rework starts with a few easy clean-ups. The real deal starts with patch 5, which adds meson's clk_regmap. This will be used as common structure to implement all the controller clocks. Having this replaces the gxbb AO controller specific regmap gate. This structure will also be re-used in upcoming controllers, such as the axg's AO and audio controllers. Each clock type is then migrated, one at a time, to this new structure. While at it, the meson clock drivers have been cleaned-up a bit, removing the gate embedded in the mpll driver, simplifying the pll driver and removing the legacy cpu_clk of meson8b The new code around the cpu clk of the meson8b is just re-implementation, using simple elements, of the old cpu_clk. What was failing before is still expected to fail now. Apparently this clock will need a bit more love to enable dvfs on meson8b. BTW, thanks a lot to Martin for trying this rework as early as he did !! With this series applied, the clock controllers of the gxbb, gxl and axg SoC will try get regmap from their parent DT node. If this fails, they will fallback to mapping the register themselves. This fallback will be kept until platform DTs have changed so clock controllers is a child of the HHI system controller. Based on this changeset, more patches are coming. For those interested, the WIP is available here [2] [0]: https://lkml.kernel.org/r/20180118110144.30619-1-jbrunet at baylibre.com [1]: https://lkml.kernel.org/r/20180122105759.12206-1-jbrunet at baylibre.com [2]: https://github.com/jeromebrunet/linux/tree/v4.16/meson/clk-regmap Jerome Brunet (19): clk: meson: use dev pointer where possible clk: meson: use devm_of_clk_add_hw_provider clk: meson: only one loop index is necessary in probe clk: meson: remove obsolete comments clk: meson: add regmap clocks clk: meson: switch gxbb ao_clk to clk_regmap clk: meson: remove superseded aoclk_gate_regmap clk: meson: add regmap to the clock controllers clk: meson: migrate gates to clk_regmap clk: meson: migrate dividers to clk_regmap clk: meson: migrate muxes to clk_regmap clk: meson: add regmap helpers for parm clk: meson: migrate mplls clocks to clk_regmap clk: meson: migrate the audio divider clock to clk_regmap clk: meson: migrate plls clocks to clk_regmap clk: meson: split divider and gate part of mpll clk: meson: rework meson8b cpu clock clk: meson: remove obsolete cpu_clk clk: meson: use hhi syscon if available drivers/clk/meson/Kconfig | 9 + drivers/clk/meson/Makefile | 5 +- drivers/clk/meson/axg.c | 722 +++++++++-------- drivers/clk/meson/axg.h | 6 +- drivers/clk/meson/clk-audio-divider.c | 63 +- drivers/clk/meson/clk-cpu.c | 178 ----- drivers/clk/meson/clk-mpll.c | 132 +--- drivers/clk/meson/clk-pll.c | 243 +++--- drivers/clk/meson/clk-regmap.c | 166 ++++ drivers/clk/meson/clk-regmap.h | 111 +++ drivers/clk/meson/clkc.h | 93 +-- drivers/clk/meson/gxbb-aoclk-regmap.c | 46 -- drivers/clk/meson/gxbb-aoclk.c | 20 +- drivers/clk/meson/gxbb-aoclk.h | 11 - drivers/clk/meson/gxbb.c | 1399 ++++++++++++++++++--------------- drivers/clk/meson/gxbb.h | 5 +- drivers/clk/meson/meson8b.c | 612 ++++++++------ drivers/clk/meson/meson8b.h | 11 +- 18 files changed, 2016 insertions(+), 1816 deletions(-) delete mode 100644 drivers/clk/meson/clk-cpu.c create mode 100644 drivers/clk/meson/clk-regmap.c create mode 100644 drivers/clk/meson/clk-regmap.h delete mode 100644 drivers/clk/meson/gxbb-aoclk-regmap.c -- 2.14.3
next reply other threads:[~2018-01-31 18:09 UTC|newest] Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-01-31 18:09 Jerome Brunet [this message] 2018-01-31 18:09 ` [PATCH 00/19] clk: meson: use regmap in clock controllers Jerome Brunet 2018-01-31 18:09 ` [PATCH 01/19] clk: meson: use dev pointer where possible Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 02/19] clk: meson: use devm_of_clk_add_hw_provider Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 03/19] clk: meson: only one loop index is necessary in probe Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 04/19] clk: meson: remove obsolete comments Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 05/19] clk: meson: add regmap clocks Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-02-08 7:33 ` Yixun Lan 2018-02-08 7:33 ` Yixun Lan 2018-02-08 8:07 ` Jerome Brunet 2018-02-08 8:07 ` Jerome Brunet 2018-02-08 8:07 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 06/19] clk: meson: switch gxbb ao_clk to clk_regmap Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 07/19] clk: meson: remove superseded aoclk_gate_regmap Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 08/19] clk: meson: add regmap to the clock controllers Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-02-03 18:53 ` Martin Blumenstingl 2018-02-03 18:53 ` Martin Blumenstingl 2018-02-05 9:51 ` Jerome Brunet 2018-02-05 9:51 ` Jerome Brunet 2018-02-05 9:51 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 09/19] clk: meson: migrate gates to clk_regmap Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 10/19] clk: meson: migrate dividers " Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 11/19] clk: meson: migrate muxes " Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 12/19] clk: meson: add regmap helpers for parm Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 13/19] clk: meson: migrate mplls clocks to clk_regmap Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 14/19] clk: meson: migrate the audio divider clock " Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 15/19] clk: meson: migrate plls clocks " Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 16/19] clk: meson: split divider and gate part of mpll Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 17/19] clk: meson: rework meson8b cpu clock Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-02-03 18:46 ` Martin Blumenstingl 2018-02-03 18:46 ` Martin Blumenstingl 2018-02-05 9:49 ` Jerome Brunet 2018-02-05 9:49 ` Jerome Brunet 2018-02-05 9:49 ` Jerome Brunet 2018-01-31 18:09 ` [PATCH 18/19] clk: meson: remove obsolete cpu_clk Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet 2018-02-03 18:48 ` Martin Blumenstingl 2018-02-03 18:48 ` Martin Blumenstingl 2018-01-31 18:09 ` [PATCH 19/19] clk: meson: use hhi syscon if available Jerome Brunet 2018-01-31 18:09 ` Jerome Brunet
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=20180131180945.18025-1-jbrunet@baylibre.com \ --to=jbrunet@baylibre.com \ --cc=carlo@caione.org \ --cc=khilman@baylibre.com \ --cc=linux-amlogic@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mturquette@baylibre.com \ --cc=narmstrong@baylibre.com \ --cc=sboyd@codeaurora.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.