mbox series

[00/10] clk: imx: Use Clock framework to register UART clocks

Message ID 20250318233849.587520-1-aford173@gmail.com
Headers show
Series clk: imx: Use Clock framework to register UART clocks | expand

Message

Adam Ford March 18, 2025, 11:38 p.m. UTC
Currenty, most peripherals enable/disable their respecive clocks using
the clock framework, but serial ports various imx platsforms do not.  Some
of the newer NXP SoC's register the UART clocks, but they are not necessarily
associated the to serial_mxc driver, so these clocks need to be manually
enabled.  Even when the driver model enumerates the UART, the driver model
doesn't always reflect the proper clock state, because these clocks are not
controlled by the serial driver.

This series does a few things:

Register the missing UART clocks on imx6, 8mm, 8mn,
fixes a build dependency on CCF_FRAMEWORK on imx8mp in SPL,
bulk enables the UART clocks from the serial_mxc driver,
and finally, removes the manual references to enabling the
UART clocks on Beacon EmbeddedWorks imx8mm, imx8mn, and imx8mp
development kits.

I don't have access to an imx6 board right now, nor do I have imx9 or
imxrt boards, so I can't verify regressions on those platforms.

For users who want to try this series and remove the manual UART calls,
make sure the SoC clock driver is enabled in SPL and OF_SPL_REMOVE_PROPS
should not remove the clocks or clock names.

With this series both "clk dump" and "dm tree" show the UART clocks are
registred and the one clocking the console UART is enabled and running.

Adam Ford (10):
  clk: imx6q: Properly handle imx6qp ESPI clk_sels
  clk: imx6q: Register UART clocks
  clk: imx8mm: register UART clocks
  clk: imx8mn: register UART clocks
  serial: mxc: Support bulk enabling clocks
  board: beacon: imx8mm: Let clock system enable UART clock
  board: beacon: imx8mn: Let clock system enable UART clock
  clk: imx: select SPL_CLK_COMPOSITE_CCF when SPL_CLK_IMX8MP
  configs: imx8mp_beacon: Select SPL_CLK_IMX8MP
  board: beacon: imx8mp: Let clock system enable UART clock

 board/beacon/imx8mm/spl.c             |  6 +----
 board/beacon/imx8mn/spl.c             |  2 --
 board/beacon/imx8mp/spl.c             |  2 --
 configs/imx8mp_beacon_defconfig       |  1 +
 drivers/clk/imx/Kconfig               |  1 +
 drivers/clk/imx/clk-imx6q.c           | 34 ++++++++++++++++++++++++---
 drivers/clk/imx/clk-imx8mm.c          | 34 +++++++++++++++++++++++++++
 drivers/clk/imx/clk-imx8mn.c          | 32 +++++++++++++++++++++++++
 drivers/serial/serial_mxc.c           | 11 +++++++++
 include/dm/platform_data/serial_mxc.h |  1 +
 10 files changed, 112 insertions(+), 12 deletions(-)

Comments

Fabio Estevam March 19, 2025, 11:41 a.m. UTC | #1
On Tue, Mar 18, 2025 at 8:42 PM Adam Ford <aford173@gmail.com> wrote:
>
> Currenty, most peripherals enable/disable their respecive clocks using
> the clock framework, but serial ports various imx platsforms do not.  Some
> of the newer NXP SoC's register the UART clocks, but they are not necessarily
> associated the to serial_mxc driver, so these clocks need to be manually
> enabled.  Even when the driver model enumerates the UART, the driver model
> doesn't always reflect the proper clock state, because these clocks are not
> controlled by the serial driver.
>
> This series does a few things:

Still fails:
https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/1068998/raw

       arm:  +   kp_imx6q_tpc
+drivers/clk/imx/clk-imx6q.c: In function 'imx6q_clk_probe':
+drivers/clk/imx/clk-imx6q.c:83:51: error: expected ')' before '{' token
+   83 |         if (of_machine_is_compatible("fsl,imx6qp") {
+      |            ~                                      ^~
+      |                                                   )
+drivers/clk/imx/clk-imx6q.c:83:9: note: '-Wmisleading-indentation' is
disabled from this point onwards, since column-tracking was disabled
due to the size of the code/headers
+      |         ^~
+drivers/clk/imx/clk-imx6q.c:83:9: note: adding '-flarge-source-files'
will allow for more column-tracking support, at the expense of
compilation time and memory
+drivers/clk/imx/clk-imx6q.c:179:1: error: expected declaration or
statement at end of input
+  179 | };
+      | ^
+drivers/clk/imx/clk-imx6q.c: At top level:
+drivers/clk/imx/clk-imx6q.c:41:12: error: 'imx6q_clk_probe' defined
but not used [-Werror=unused-function]
+   41 | static int imx6q_clk_probe(struct udevice *dev)
+      |            ^~~~~~~~~~~~~~~
+drivers/clk/imx/clk-imx6q.c:39:26: error: 'ecspi_sels' defined but
not used [-Werror=unused-const-variable=]
+   39 | static const char *const ecspi_sels[] = { "pll3_60m", "osc", };
+      |                          ^~~~~~~~~~
+drivers/clk/imx/clk-imx6q.c:38:26: error: 'uart_sels' defined but not
used [-Werror=unused-const-variable=]
+   38 | static const char *const uart_sels[] = { "pll3_80m", "osc", };
+      |                          ^~~~~~~~~
+drivers/clk/imx/clk-imx6q.c:36:26: error: 'periph_pre_sels' defined
but not used [-Werror=unused-const-variable=]
+   36 | static const char *const periph_pre_sels[] = { "pll2_bus",
"pll2_pfd2_396m",
+      |                          ^~~~~~~~~~~~~~~
+drivers/clk/imx/clk-imx6q.c:35:26: error: 'periph_sels' defined but
not used [-Werror=unused-const-variable=]
+   35 | static const char *const periph_sels[]  = { "periph_pre",
"periph_clk2", };
+      |                          ^~~~~~~~~~~
+drivers/clk/imx/clk-imx6q.c:26:23: error: 'imx6q_clk_ops' defined but
not used [-Werror=unused-variable]
+   26 | static struct clk_ops imx6q_clk_ops = {
+      |                       ^~~~~~~~~~~~~
+cc1: all warnings being treated as errors
+make[4]: *** [scripts/Makefile.build:257: drivers/clk/imx/clk-imx6q.o] Error 1
+make[3]: *** [scripts/Makefile.build:398: drivers/clk/imx] Error 2
+make[2]: *** [scripts/Makefile.build:398: drivers/clk] Error 2
+make[1]: *** [Makefile:1917: drivers] Error 2
+make: *** [Makefile:177: sub-make] Error 2