Commit graph

1584 commits

Author SHA1 Message Date
Tom Rini
ff0b7d741d Qualcomm changes for v2025.07
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEtlGhRjxqvtBpDFXNBYMxKxlfZLYFAmf5HL8ACgkQBYMxKxlf
 ZLaY6A//Ry5wkX1f/WTVFUO6gBJQom6hsEpkNgYwtgzaWOWhqvR53e5sbsiMPKnO
 5BRtKhrs0Jp2/kl06+k5tsGQbr3rogvwNS9m8DFyF2Hfq7uT2ooQKzxeBM9MaGhI
 p+7d92JjcHeYP7ejWcoAnag0ZvM/3iofdsrRcGsFjbYbcbAkBtAUDj2RqaZFIAFk
 A6g6/IZ62K6QH24oAMPv5yR4ru2tfzRMJHdZh79FHMXNp9wOLgMsHAV8NToQ/ZHU
 ACn9EHc4g9aI8h8gXPTEjCzOx6saYcmV+zzn0mSeICCSbOqvJ/C2/96NUlD5BW8/
 XFIeuBNgnHyxv4O3idFpyaxF34SMp2j2dDAIQFLN+0lG1M1Zi75pqf9UzlSvvSjm
 d1xd/LbrOEwNEyTKG7Ss0e3nf03lP22s2COpFUPJAijkfRZ8K/Y8RISeQv+MJKwa
 AZqYofLua0Uo0kuKTiHuOdD5oWUxmEcjtisaP/X9hcXWteTillntp120qm/a93s2
 X015V56B/e2+uf9xAQW+iqnrcgpMGKffqbs7tVhVr3SDTDa+c4/c6EXX2naqzgDQ
 T/S0hetOONuNXZvyAguUq5HKNI0IoC+OZQhA1uIgq+JyV/7qgENyrERlt29435cg
 NAr+410m0OKYUGHz5xwLSUh2j68v/4fZj7I4nZt4eYjEfYk/2dI=
 =Ep2x
 -----END PGP SIGNATURE-----

Merge tag 'qcom-for-2025.07' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

Qualcomm changes for v2025.07:

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/25653

There's been a surprising amount of activity lately on the Qualcomm
side with the two oldest boards getting some fresh attention and a lot
of cleanup and polish going on across the board.

* SDM660 gets USB phy fixes and a pinctrl driver
* The recently added SA8775P/QCS9100 SoC gets a pinctrl driver
* The Qualcomm pinctrl driver now handles reserved pins correctly,
  fixing crashes on some boards when running "gpio status -a"
* OF_UPSTREAM_BUILD_VENDOR is enabled in qcom_defconfig
* SDM845 and SC7280 get missing clocks added (since we're now stricter
  about those). This gets USB working more reliably in more cases.
* DM_USB_GADGET is enabled for all boards using DWC3 and fasbtoot is
  enabled too
* A bug in the livetree fixup code is fixed (making USB work on a lot
  more platforms)
* Button label lookup is made case insensitive* bootretry becomes more dynamic, allowing it to be hijacked to make a
  "persistent" boot menu that allows dropping to U-Boot shell later on
* A new qcom-phone.config fragment is added along with a phone-specific
  default environment and phone-specific debugging/bringup docs. These
  make U-Boot more usable on devices without a serial port or keyboard.
* The db820c gets fixed up and updated documentation
* The db410c also gets some love and modernisation as well as a new
  reviewer.
* A new driver is added for the USB VBUS regulator found on various
  Qualcomm PMICs
* The Qualcomm SPMI driver gets some fixes and cleanup for SPMI v5 and
  v7 support.
2025-04-11 09:12:16 -06:00
Miquel Raynal
e05d706ff6 clk: imx8mp: Add media related clocks
These are all the clocks needed to get an LCD panel working, going
through one of the LCDIF and the LDB. The media AXI and APB clocks are
also described.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2025-04-10 22:32:56 -03:00
Miquel Raynal
ac30d90f33 clk: Ensure the parent clocks are enabled while reparenting
Reparenting a clock C with a new parent P means that C will only
continue clocking if P is already clocking when the mux is updated. In
case the parent is currently disabled, failures (stalls) are likely to
happen.

This is exactly what happens on i.MX8 when enabling the video
pipeline. We tell LCDIF clocks to use the VIDEO PLL as input, while the
VIDEO PLL is currently off. This all happens as part of the
assigned-clocks handling procedure, where the reparenting happens before
the enable() calls. Enabling the parents as part of the reparenting
procedure seems sane and also matches the logic applied in other parts
of the CCM.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2025-04-10 22:32:55 -03:00
Jorge Ramirez-Ortiz
7afddbee3b
clk: stub: add qcom,glink-smd-rpm
Add support for the resource power manager clocks over SMD/GLINK to be
stubbed.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250407175617.3494506-4-jorge.ramirez@oss.qualcomm.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:11 +02:00
Jorge Ramirez-Ortiz
8fc48d1a01
clk/qcom: apq8096: fix the sdhci clock
Select the right clock for sdhci.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250407175617.3494506-3-jorge.ramirez@oss.qualcomm.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:11 +02:00
Jorge Ramirez-Ortiz
1561b01a08
clk/qcom: apq8096: fix set rate for the uart clock
The function should return a valid rate.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407175617.3494506-2-jorge.ramirez@oss.qualcomm.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:11 +02:00
Caleb Connolly
2c1462e38b
clk/qcom: sc7280: add missing UFS and MMC clocks
These are all usually enabled, hence we don't (yet) bother configuring
their RCG src clocks.

Add them to remove the errors about missing clocks when the UFS and MMC
drivers probe.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250317-sc7280-mmc-ufs-clocks-v1-2-38e05c16511b@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:10 +02:00
Caleb Connolly
c8db6bdba6
clk/qcom: sdm845: add GCC_AGGRE_UFS_PHY_AXI_CLK
Missing for UFS.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250324-sdm845-fixes-fastboot-v1-2-d177a10f336d@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:08 +02:00
Caleb Connolly
7c07628e5b
clk/stub: add sdm845 rpmh clock
Necessary for UFS to successfully probe all clocks.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250324-sdm845-fixes-fastboot-v1-1-d177a10f336d@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:08 +02:00
Sam Day
ec8209d04a
clk/qcom: sdm845: add missing USB3 clocks
These are necessary for USB gadget to come up properly, now that
qcom_gate_clk_en fails on unknown clocks.

Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250319-sdm845-usb-clocks-v1-1-ddea854f62ec@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-10 15:43:08 +02:00
Tom Rini
ff61d6bfd1 Merge branch 'next'
Note that this undoes the changes of commit cf6d4535cc ("x86:
emulation: Disable bloblist for now") as that was intended only for the
release due to time.
2025-04-08 11:43:23 -06:00
Andrew Davis
03e3fdd3d0 arm: mach-k3: j721e: Split out J7200 SoC support from J721e
Currently in j721e_init.c we check which firewalls to remove using
the board configuration (e.g CONFIG_TARGET_J721E_R5_EVM). We do this
as J721e and J7200 have different IP and firewalls but use the same
SoC definition (SOC_K3_J721E) even though they are different SoCs.

The idea was they would be similar enough that they both could use
the same SoC config to help with common code sharing. Board checks
would then be used differentiate.

This has grown far too messy to maintain any more, especially now
that there is more than one board using J721e (EVM, SK, Beagle AI64).
As differentiation is done based on board, every one of these boards
would have to have checks added for them. Instead let's split J7200
support out from J721e like how normal new SoC support is done.

This patch touches several subsystems and could not be split much better
as when we add SOC_K3_J7200 we want to make use of it in all spots that
once used the combined SOC_K3_J721E so we can turn off SOC_K3_J721E when
building for J7200 boards.

Signed-off-by: Andrew Davis <afd@ti.com>
2025-04-05 18:28:02 -06:00
Tom Rini
ccb3826054 Merge patch series "Introduce J742S2 SoC and EVM"
Manorit Chawdhry <m-chawdhry@ti.com> says:

The series adds support for J742S2 family of SoCs. Also adds J742S2 EVM
Support and re-uses most of the stuff from the superset device J784s4.

This device is a subset of J784S4 and shares the same memory map and
thus the code is being reused from J784S4 to avoid duplication.

It initially cleans up the J784s4 and AM69 files so that they can be
re-usable for j742s2 and then it introduces J742S2.

The DT for the following SoC will be coming to U-boot during 6.13 Sync
so the series is kept as RFC till then.

Here are some of the salient features of the J742S2 automotive grade
application processor:

The J742S2 SoC belongs to the K3 Multicore SoC architecture platform,
providing advanced system integration in automotive, ADAS and industrial
applications requiring AI at the network edge. This SoC extends the K3
Jacinto 7 family of SoCs with focus on raising performance and
integration while providing interfaces, memory architecture and compute
performance for multi-sensor, high concurrency applications.

Some changes that this devices has from J784S4 are:
* 4x Cortex-A72 vs 8x Cortex-A72
* 3x C7x DSP vs 4x C7x DSP
* 4 port ethernet switch vs 8 port ethernet switch
* 2 DDR controller vs 4 DDR controller

Test logs:
https://gist.github.com/manorit2001/f7df0e8cca1e9973b4361f0559c6f53d

Link: https://lore.kernel.org/r/20250317-b4-upstream-j742s2-v4-0-4ba88bfd357a@ti.com
2025-04-03 11:37:57 -06:00
Manorit Chawdhry
dd837d6c88 arm: mach-k3: j742s2: Introduce clock and device files for J742S2 SoC
Re-use j784s4 clocks and power domains for j742s2 family of device.

Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2025-04-03 11:37:46 -06:00
Tom Rini
80c61c5ce8 Merge patch series "airoha: Add initial support AN7581"
Christian Marangi <ansuelsmth@gmail.com> says:

This little series adds initial support for Airoha AN7581 SoC.

With the help of some backport patch, this use OF_UPSTREAM
directly.

Posting this to have the targer and the very basic driver.

Ethernet, SNAND and eMMC support is already ready downstream
and will be posted shortly after this gets approved.

Having the first driver ready permits to separately push
dedicate series for SNAND, eMMC and Ethrnet as they all depends
on basic support of clock and reset and nothing else.

Link: https://lore.kernel.org/r/20250314185941.27834-1-ansuelsmth@gmail.com
2025-04-01 08:45:46 -06:00
Christian Marangi
b02b8b7676 reset: airoha: Add driver for controlling reset line of AN7581
Add driver for controlling the reset lines of AN7581. This is a detached
version of the clock controller driver present in Linux only used to
control reset lines. Driver gets loaded with the bind of the clock
driver and doesn't require a compatible. This is needed as they share
the same registers.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-04-01 08:44:51 -06:00
Christian Marangi
d0b81afb5e clk: airoha: Add support for Airoha AN7581 SoC clock
Add support for Airoha AN7581 SoC clock driver. This mainly needed for
eMMC support to correctly get the current clock applied.

Based on the Linux clk-en7523.c but majorly reworked for U-Boot that
doesn't require CCF subsystem.

Major modification, support for set_rate, realtime get_rate and split
for reset part to a different driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-04-01 08:44:51 -06:00
Andre Przywara
7d1936aef7 clk: sunxi: Add support for the A100/A133 CCU
The Allwinner A100 SoC has been around for a while, and has now seemingly
been replaced with its close sibling A133.

Add support for the CCU, as far as used by U-Boot proper. Linux has some
basic (clock and pinctrl) support for a while, so we can already use the
existing binding headers.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2025-03-27 00:26:35 +00:00
Tom Rini
042c8f0cb1 Merge tag 'u-boot-imx-next-20250325' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/25324

- Imply the i.MX thermal driver by default on imx8, imx9, imx8m.
- Add clk_resolve_parent_clk() and fix up iMX clock drivers.
2025-03-25 08:57:38 -06:00
Yao Zi
02933626c7 clk: sophgo: Fix return values of register updating helpers
These helpers wrongly return the updated register value. As a non-zero
value indicates failure, this causes various clock operations are
considered failed.

Correct the return value to constant zero, since these simple MMIO
operations won't fail. This fixes clock enabling failures during booting
process,

	In:    serial@4140000
	Out:   serial@4140000
	Err:   serial@4140000
	Net:   Enable clock-controller@3002000 failed
	failed to enable clock 0
	No ethernet found.

which leads to misoperation of various peripherals.

Fixes: 5f364e072e ("clk: sophgo: cv1800b: Add clock controller driver for cv1800b SoC")
Tested-by: Yuguo Pei <purofle@gmail.com>
Signed-off-by: Yao Zi <ziyao@disroot.org>
2025-03-25 12:13:42 +08:00
Tom Rini
d574229880 qcom-next-20230324
take 2
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEtlGhRjxqvtBpDFXNBYMxKxlfZLYFAmfhkqIACgkQBYMxKxlf
 ZLY5Ig/+J9R0ZC9qJxQXZHANfWRUsCwn9UDnc/cYgo6eD/E87Tgdr85vlH44JOh9
 wka2ysn6H4IaN7Ca4435GUjntvuhJ85HLXhbBuQXOT27fHSIV0MJq94jvGwDzSps
 IOy9JSYHhbs5tP33ekXfLYlL60BFqcTm22VXUfAXD9mMkDonbh4vq1LPxskVj8iq
 85k5F2GyFm5cU4H5nQpgI+6+LQSJ/FlraOGNOYQj7MiQzTxPkWL6hC+p+9RuJAbt
 NLJiDd3oQUgpo9/jQseteNXrUfQYsUmuzjrz71V2Z9saIHKw+AuVcnr/EanynjiJ
 JjKdQ3Xmu3zwdTGP3/c/ZIxy1vKq4qoVnjzHo8x/am7euPNnj9lS7liq618/qhtv
 AuCf6SSpXqKFMejXn/mF28sO0merI5oM3OB7AEL+BOH5HIaNr39PyAQ+8HKh5tmb
 7lB1z/LjSPvpapQOZqj2XTBcNuxFT6rD4Nl5CFlJLjcGdMd6BRpCulE8z/53VSwH
 FDEi0pqsN4No1anA8XMial7BEtCrM1e9NO3X+RRXCbxGZHa37fwlFmzTbpqUZcRA
 iv0YmXvv2PT3+W/tuwS8d2ZgTSctFSAoKd5B9iuDiuNko/teUbKFREY7E/rB7Oky
 AcNUT6ILmsqNg+BnkXu3Z+NP+Ms30FOxK/pEptek0vfLwJuAhg8=
 =2n9a
 -----END PGP SIGNATURE-----

Merge tag 'qcom-next-20250324' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon into next

qcom-next-20230324:

* msm8916 gets proper sysreset and spin-table support
* The first new IPQ platform is added - the IPQ9574. The IPQ series are
  used in routers. The flashing process is also documented
* mach-snapdragon gains the ability to boot with an internal FDT and
  still parse memory from an externally provided one
* SC7280 gets a pinctrl driver and various clock driver improvements.
* Qualcom clock drivers will now actually return an error when
  attempting
  to enable a clock which isn't described.
* Qualcomm pinctrl drivers will now return an error when attempting to
  configure an invalid function mux
2025-03-24 12:38:48 -06:00
Marek Vasut
2a7ab5f6c6 clk: imx: Pass struct udevice into imx_clk_fixed_factor*()
Pass struct udevice * into imx_clk_fixed_factor*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
b185878b32 clk: clk-fixed-factor: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
1987fa7b34 clk: clk-fixed-factor: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-fixed-factor registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
09fa54f6da clk: clk-divider: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
df9c287e42 clk: imx: Pass struct udevice into imx_clk_divider*()
Pass struct udevice * into imx_clk_divider*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
e14dd5c35a clk: clk-divider: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-divider clock registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
63fa948550 clk: imx: pllv3: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
8c1024636f clk: imx: Pass struct udevice into imx_clk_pllv3*()
Pass struct udevice * into imx_clk_pllv3*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:35 -03:00
Marek Vasut
b4734c9c33 clk: imx: Convert clock-osc-* back to osc_*
Convert clock-osc-24m back to osc_24m and clock-osc-32k back to osc_32k.
These are the clock which match clock tables in Linux. This is now
possible because the clock drivers now resolve clock names based on
clock-names DT property in the CCM DT node.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
bcb141d114 clk: imx: Pass struct udevice into imx_clk_composite*()
Pass struct udevice * into imx_clk_composite*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
f98cd471f0 clk: clk-composite: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
45c6b6a850 clk: clk-composite: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-composite registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
86bde56bcc clk: imx: Pass struct udevice to clk_register_gate*()
Pass U-Boot specific struct udevice pointer to clock parent device
to clk_register_gate*(), so clk_register_gate*() can access the parent
udevice.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
e7f32d7561 clk: imx: Pass struct udevice into imx_clk_gate*()
Pass struct udevice * into imx_clk_gate*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
5d82183d4a clk: imx: gate2: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
2eafd7a28e clk: imx: gate2: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in gate2 clock registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
742e0205d1 clk: clk-gate: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
aee51ad0d9 clk: clk-gate: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-gate registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
0a930930f8 clk: imx: Pass struct udevice to clk_register_mux()
Pass U-Boot specific struct udevice pointer to clock parent device
to clk_register_mux(), so clk_register_mux() can access the parent
udevice.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
eca4e5e013 clk: imx: Pass struct udevice into imx_clk_mux*()
Pass struct udevice * into imx_clk_mux*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
3070d30df1 clk: clk-mux: Resolve parent clock by name
Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
54a4c83b12 clk: clk-mux: Use struct udevice instead of struct device
Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-mux registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
7cc520fe29 clk: clk-mux: Fold clk_register_mux()
Neither clk_register_mux_table() nor clk_hw_register_mux_table()
are called outside of clk-mux.c , fold both into clk_register_mux().
No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Marek Vasut
1054163c4d clk: Add clk_resolve_parent_clk()
Add clk_resolve_parent_clk() to resolve parent clock udevice name
based on clock-names DT property. This is used in SoC clock drivers
to look up the clock name in clock tables, which matches a clock
name in DT clock-names property, and convert it into udevice name
which is used by U-Boot clock framework to look up parent clock in
e.g. clk_register() using uclass_get_device_by_name(UCLASS_CLK,
parent_name, &parent);

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24 08:51:34 -03:00
Adam Ford
225b3a7783 clk: imx: select SPL_CLK_COMPOSITE_CCF when SPL_CLK_IMX8MP
If SPL_CLK_IMX8MP is selected alone, it causes a build error.
The clock composite is required when using the clock framework, so
select it when SPL_CLK_IMX8MP is enabled.  This is already being
done outside of SPL.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19 13:17:21 -03:00
Adam Ford
8999b76f23 clk: imx8mn: register UART clocks
In order to let the serial driver enable the clocks, the UART clocks
must be registered first.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19 13:17:21 -03:00
Adam Ford
6d33ca36e3 clk: imx8mm: register UART clocks
In order to let the serial driver enable the clocks, the UART clocks
must be registered first.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19 13:17:21 -03:00
Adam Ford
c60bdd2740 clk: imx6q: Register UART clocks
In order to use the driver model and clock system to enable UART
clocks from the serial driver, it's necessary to register the UART
clocks.  With the helper function to check for imx6qp vs other
variants, the UART can register for both scenarios.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19 13:17:21 -03:00
Adam Ford
4e73c627cb clk: imx6q: Properly handle imx6qp ECSPI clk_sels
The ECSPI clock has the ability to select between pll3_60m and
osc on the imx6qp, where it's fixed on other variants.  Fix this
by adding using a helper function to determine SoC variant and
register the clock accordingly.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19 13:17:21 -03:00