Commit graph

1246 commits

Author SHA1 Message Date
Tom Rini
9cfef5fcfb Merge patch series "Add support for MediaTek MT8365 EVK Board"
Julien Masson <jmasson@baylibre.com> says:

This patch series add the support for the MediaTek MT8365 EVK Board [1].
Most of the code have been copied/adapted from Linux tag v6.7-rc2.

For now we only enable/test these features:
Boot, UART, Watchdog and MMC.

[trini: This includes two clocks not listed in the Linux binding, which
 needs resyncing later]
2023-12-19 11:42:03 -05:00
Julien Masson
ac80c6a647 clk: mediatek: add clock driver support for MediaTek MT8365 SoC
This patch adds clock driver support for MediaTek MT8365 SoC.
The changes are based on the Linux source code tag v6.7-rc2.

clk-mt8365.c has been written based on these kernel files:
- clk-mt8365.c (a96cbb146a9736f501fe66ebda6a9018735e5e8a)
- clk-mt8365-apmixedsys.c (65c9ad77cbc0eed78db94d80041aba675cfbdfa9)
And adapted following the clk attributes supported by U-Boot.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-12-19 10:09:06 -05:00
Tom Rini
1373ffde52 Prepare v2024.01-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmWARagACgkQFHw5/5Y0
 tyyB/gv9HPhYpvmGi8GcqmlQ2Y2fDr5c5Tti0BUMtMzLGM/J8CEcfSF4oPmdPy3f
 NHHWlCTzO8HHtoCZg1h5NknbrFaYVFdrKAV/Vy7JDH9J+/uEd39i6UJUO3TkIcpr
 Ykb6eXL1OdTnjVFOs3VPcLc93No3Rb3chC1aqb447r1rgWc+uqyZcQrdDMyko6sh
 e0l+JRlpi0xprwF5/THKbNdnU4XrryRtienpFclzSwrAzz3vuoUteqRwQY7auttz
 RQMlTQooV1D73bOc2kZjLKH5xXdjU3bT9PetR/mHkzCDa6xbNy/OWxnpS8b4+dVh
 cjTpeHcgDIRjtOv9kmi4fZPt4865KxJ5jk8WCCfOwPRlgUe0q3tJgEQMBy3fEgNw
 BmnzLVqpHAAMQZDx93D8RxdzyiInGATIMfdFFPQ04R/UqNCO3XmSnHno4CZ/lm4w
 fjiP7NgwKe7rnXNbhCdBEmZqfwb7MA5RQ5/zxsdbeIuk5tOIMi7nBa+CNLUGD7bh
 6QGsTrYf
 =lS+J
 -----END PGP SIGNATURE-----

Merge tag 'v2024.01-rc5' into next

Prepare v2024.01-rc5
2023-12-18 09:55:32 -05:00
Tom Rini
8bb3cd7fe7 clock patches for u-boot/next
The main thing in here is Igor's conversion of soc_clk_dump to a clk_ops
 member. There's also a write-protect feature for nuvoton clocks.
 
 Signed-off-by: Sean Anderson <seanga2@gmail.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEkGEdW86NSNID6GAoPuiP7LShEG4FAmV8uvhfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkw
 NjExRDVCQ0U4RDQ4RDIwM0U4NjAyODNFRTg4RkVDQjRBMTEwNkUACgkQPuiP7LSh
 EG5TtQf+N5BIVCRDFgFT7rM1lGYVtJEOm+oj58zQfM4MUAp2LKCHbHv7c8ZMUmdu
 SJPJiDW4I2xQqAaawxcSub4L5d0G22SopotIVOcQXXTFFeW8rdpcRjhPhyIuHN8w
 6dOo8T9U+BMjoNgtY48nNAhkzDGUDVJRZ/uBt8F1U6hKjk5OisSFyBfPZMtuvr/D
 EBG8QqzXOMujrm9HGSVipvnSbgGX+QqtST4mVoatvQJ3DWYXxq8O5BPJFer1DL3F
 BcI9yNaOG/L6MXAA3wkjh3nYLXoiRUgo2DRag++XMHnXYQ/xFzekraNAFHGDQslQ
 Gnjz+5xp/z4ywOEkHSuI3mZIICBJ1Q==
 =z+Sl
 -----END PGP SIGNATURE-----

Merge tag 'clk-2024.01-next' of https://source.denx.de/u-boot/custodians/u-boot-clk into next

clock patches for u-boot/next

The main thing in here is Igor's conversion of soc_clk_dump to a clk_ops
member. There's also a write-protect feature for nuvoton clocks.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-12-15 17:49:13 -05:00
Yang Xiwen
d306182439 test: dm: clk_ccf: test ccf_clk_ops
Assign ccf_clk_ops to .ops of clk_ccf driver so that it can act as an
clk provider. Also add "#clock-cells=<1>" to its device tree node.

Add "i2c_root" to clk_test in the device tree and driver for testing.

Get "i2c_root" clock in CCF unit tests and add tests for it.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v3-2-08a821892fa9@outlook.com
2023-12-15 13:50:44 -05:00
Jim Liu
652d8d4561 clk: nuvoton: add read only feature for clk driver
Add a flag to set ahb/apb/fiu/spi clock divider as read-only
The spi clock setting is related to booting flash, it is setup by early
bootloader.
It just protects the clock source and can't modify it in uboot.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231114090004.3746024-1-JJLIU0@nuvoton.com
2023-12-15 13:05:55 -05:00
Igor Prusov
bc3e313ff6 clk: treewide: switch to clock dump from clk_ops
Switch to using new dump operation in clock provider drivers instead of
overriding soc_clk_dump.

Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-8-ivprusov@sberdevices.ru
2023-12-15 13:05:54 -05:00
Igor Prusov
4f48202ba8 clk: amlogic: Move driver and ops structs
Move driver and ops structs to avoid forward declaration after switching
to dump in clk_ops.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-5-ivprusov@sberdevices.ru
2023-12-15 12:33:09 -05:00
Igor Prusov
77beaad3d1 clk: k210: Move soc_clk_dump function
Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-4-ivprusov@sberdevices.ru
2023-12-15 12:33:09 -05:00
Igor Prusov
3f192541df clk: ast2600: Move soc_clk_dump function
Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-3-ivprusov@sberdevices.ru
2023-12-15 12:33:09 -05:00
Igor Prusov
bdac755114 clk: zynq: Move soc_clk_dump to Zynq clock driver
Move clock dump function in preparation for switching to dump function
in clk_ops.

Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-2-ivprusov@sberdevices.ru
2023-12-15 12:33:09 -05:00
Igor Prusov
54d7da7730 clk: Check that composite clock's div has set_rate()
It's possible for composite clocks to have a divider that does not
implement set_rate() operation. For example, sandbox_clk_composite()
registers composite clock with a divider that only has get_rate().
Currently clk_composite_set_rate() only checks thate rate_ops are
present, so for sandbox it will cause NULL dereference during
clk_set_rate().

This patch adds rate_ops->set_rate check tp clk_composite_set_rate().

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-2-ivprusov@salutedevices.com
2023-12-15 12:32:00 -05:00
Yang Xiwen
3fb2d3d6ac clk: get correct ops for clk_enable() and clk_disable()
assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations
are called on clocks.

This fixes the incorrect enable_count issue as described in [1].

[1]: https://lore.kernel.org/all/SEZPR06MB695927A6DEEEF8489A06897396A7A@SEZPR06MB6959.apcprd06.prod.outlook.com/

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v2-2-20e3728600b5@outlook.com
2023-12-15 12:31:47 -05:00
Yang Xiwen
09844d0de5 clk: check parent_name in clk_register to avoid confusing log_error() output
For some gate clocks and fixed clocks without a parent, calling
clk_register will print an useless error message indicating that parent
is missing. Fix that by gaurding log_xxx() with an if-statement.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Suggested-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230807-clk-fix-v2-1-0b688e21fb4e@outlook.com
2023-12-15 12:31:15 -05:00
Dario Binacchi
767ca6d682 clk: stm32f: fix setting of LCD clock
Set pllsaidivr only if the PLLSAIR output frequency is an exact multiple
of the pixel clock rate. Otherwise, we search through all combinations
of pllsaidivr * pllsair and use the one which gives the rate closest to
requested one.

Fixes: 5e993508cb ("clk: clk_stm32f: Add set_rate for LTDC clock")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-12-15 15:03:18 +01:00
Dario Binacchi
bd6eb5ddd7 clk: stm32f: fix setting of division factor for LCD_CLK
The value to be written to the register must be appropriately shifted,
as is correctly done in other parts of the code.

Fixes: 5e993508cb ("clk: clk_stm32f: Add set_rate for LTDC clock")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-12-15 15:03:18 +01:00
Tom Rini
fa3f19aa56 Xilinx changes for v2024.04-rc1
zynqmp:
 - Introduce Kria specific defconfig
 - Calculate SPI image location based on boot offset
 - DT updates
 
 zynqmp-clk:
 - Fix topsw_lsbus_clock for DP
 
 axi-enet:
 - Support older DT binding
 
 mailbox:
 - Add support for multiple mailboxes
 
 pcie-xilinx:
 - Covert driver to newer interface
 - Enable MMIO region
 
 zynq:
 - dfu updates
 - Enable capsule update for Antminer S9
 - DT updates
 
 xilinx_spi:
 - Add new xfer callback and support runtime fifo depth discovery
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZXsiwgAKCRDKSWXLKUoM
 IUaSAJ4/8Ku3aUP/wDnRZmIIziw36I7WOwCeJrqfPSoYhPG+XCJhPQ076wid9cw=
 =PHig
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2024.04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2024.04-rc1

zynqmp:
- Introduce Kria specific defconfig
- Calculate SPI image location based on boot offset
- DT updates

zynqmp-clk:
- Fix topsw_lsbus_clock for DP

axi-enet:
- Support older DT binding

mailbox:
- Add support for multiple mailboxes

pcie-xilinx:
- Covert driver to newer interface
- Enable MMIO region

zynq:
- dfu updates
- Enable capsule update for Antminer S9
- DT updates

xilinx_spi:
- Add new xfer callback and support runtime fifo depth discovery
2023-12-14 13:27:11 -05:00
Venkatesh Yadav Abbarapu
4f340244b9 clk: zynqmp: enable topsw_lsbus clock
Display port is using topsw_lsbus clock, it is failing
while enabling the clock, so enable the topsw_lsbus clock.

Signed-off-by: Sreekanth Sunnam <sreekanth.sunnam@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231204084515.9488-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-12-13 16:48:15 +01:00
Nicolas Heemeryck
cb1d68b143 clk: imx8mn: add pwm clocks
Based on Linux kernel 6.7-rc4, add necessary clocks for the PWM
controllers.

Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2023-12-13 10:03:46 -03:00
Chanho Park
8ef2d7926f clk: starfive: jh7110: Add watchdog clocks
Add JH7110_SYSCLK_WDT_APB and JH7110_SYSCLK_WDT_CORE clocks for JH7110
watchdog device.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-12-05 16:40:16 +08:00
Tom Rini
d379150621 Prepare v2024.01-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVuHrwACgkQFHw5/5Y0
 tyy3Tgv+LB/X0ZR3IHnu1mvQ7kpOFvAjjKr0BUpcEEzsrDZeJnS6sy06m+REez2E
 UmuLeKFj5NUCYXNKtxn2+gVnJt8Tk6ftxhMTiZHmR4Y4NVc5aPtqYmVsv6Q29j0U
 mcg7AGcZTniu9/naNM+ZcDeHzLDAB0whmE9eVfixXVgyitILoLHNdFiQ7W4oR7Kh
 /mBgdMDBS3rqiRi6CuqKUnl4ADX8T3AXaSfi3hqOC5Pj+HPkZSUfyWx31mu9mN1D
 wXTHASZX06Dop25fm/ZSdWk1blBw29WqRiJBdwNatvyC5pqMsotTvAfH2AcHBEYg
 tpoper+WDOBAipt6b6Y1B7q4VPvJ97L9dFCAYqN0nGCe+rkdi+k+cly7M6Ye9xLt
 e7rVUfnKgIMP8jkLcVBYoWkFY5FiJ82O5qjoF5N3dAuHeWacDFsB5TugDTOQvblH
 LWCmcIyU1N9Ma/Ib0rTvNduvpBUYBKXYlD1+rjPZUbTUnfc79mf+ReFpcoW6Kxh+
 bkz81p8P
 =ebIZ
 -----END PGP SIGNATURE-----

Merge tag 'v2024.01-rc4' into next

Prepare v2024.01-rc4

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVuHrwACgkQFHw5/5Y0
# tyy3Tgv+LB/X0ZR3IHnu1mvQ7kpOFvAjjKr0BUpcEEzsrDZeJnS6sy06m+REez2E
# UmuLeKFj5NUCYXNKtxn2+gVnJt8Tk6ftxhMTiZHmR4Y4NVc5aPtqYmVsv6Q29j0U
# mcg7AGcZTniu9/naNM+ZcDeHzLDAB0whmE9eVfixXVgyitILoLHNdFiQ7W4oR7Kh
# /mBgdMDBS3rqiRi6CuqKUnl4ADX8T3AXaSfi3hqOC5Pj+HPkZSUfyWx31mu9mN1D
# wXTHASZX06Dop25fm/ZSdWk1blBw29WqRiJBdwNatvyC5pqMsotTvAfH2AcHBEYg
# tpoper+WDOBAipt6b6Y1B7q4VPvJ97L9dFCAYqN0nGCe+rkdi+k+cly7M6Ye9xLt
# e7rVUfnKgIMP8jkLcVBYoWkFY5FiJ82O5qjoF5N3dAuHeWacDFsB5TugDTOQvblH
# LWCmcIyU1N9Ma/Ib0rTvNduvpBUYBKXYlD1+rjPZUbTUnfc79mf+ReFpcoW6Kxh+
# bkz81p8P
# =ebIZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 04 Dec 2023 01:47:24 PM EST
# gpg:                using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C
# gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate]
2023-12-04 21:39:57 -05:00
Tom Rini
b2bf18d5e5 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsung 2023-11-28 10:05:25 -05:00
Tom Rini
dca7a8958f Prepare v2024.01-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVbZ4QACgkQFHw5/5Y0
 tyzlggwAowkAYxSOUkwhWSbEYctVObZUPF1kDEbWlbskx52ZrQ56nWbfojZPKYdT
 OYe7fNrOJaYpbpU31lJ6U7Jm/iLCHw7vqMBmTJCNNr/BBW5jQ/exEVMa+/ZG640T
 6pTWqAHp3CfqNjBK9bnFmIqWTwrqUCZKNllPfEWNs1Pl00ypJsY9ZYaAw+4I9t0p
 2cG/BrSUyCDkgLYHi0YVUHXWQKYU4LVfz6EASGIOwTrrJGEUJ9EAGJmzgUSC0Zuw
 7qQBwHPXHBkpfP4bOFZ6xSKLp79rHXNSdjx21XW/4yerp4GC16xB+pZWZOSuz2J9
 0anoiSGPh1N81B6aciTOWeCdKPJeXEp1AxqyCcvmwLZrOOs+MSGjbKCUFnjyNtAJ
 hTXzlJQM6tQ3BhGQLY85sNe8/dOF3WNt4RiRM3K87mU8e0pahrYKSj5oUSbcrOBx
 4Hk6rQc33MvyLAYEhSJ3naktA0dPQseleOrXuOGdSWOlFf2sweVEjip4VKBlbUNb
 t3kEfQ9F
 =YBkC
 -----END PGP SIGNATURE-----

Merge tag 'v2024.01-rc3' into next

Prepare v2024.01-rc3
2023-11-20 09:19:50 -05:00
Igor Prusov
13248d66ae treewide: use linux/time.h for time conversion defines
Now that we have time conversion defines from in time.h there is no need
for each driver to define their own version.

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com> # tegra
Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> #at91
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> #qcom geni
Reviewed-by: Stefan Bosch <stefan_b@posteo.net> #nanopi2
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-11-16 18:59:58 -05:00
Sam Protsenko
f655090901 clk: exynos: Add header guard for clk-pll.h
The clk-pll.h is going to be included in multiple files soon. Add
missing header guard to prevent possible build errors in future.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: 166097e877 ("clk: exynos: add clock driver for Exynos7420 Soc")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2023-11-13 16:39:05 +09:00
Samuel Holland
ca43266562 clk: sunxi: Use the right symbol in the Makefile
CONFIG_ARCH_SUNXI will not be enabled for RISC-V SoCs using this driver.
Use the symbol for the driver itself instead.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2023-11-12 16:46:16 +00:00
Nishanth Menon
a94a4071d4 tree-wide: Replace http:// link with https:// link for ti.com
Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-10 11:01:50 -05:00
Tom Rini
d563bb5d16 clk_k210.c: Clean up how we handle nop
Now that sandbox has <asm/barrier.h> and defines nop() there we should
include that in our driver for clarity and then remove our local nop()
from <k210/pll.h>.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07 14:49:40 -05:00
Alexey Romanov
8ec790399a clk: a1: add new clocks for USB stack
Since we sync device tree with Linux, we have to add this
clock definition for USB stack.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231101140500.9025-2-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-06 09:45:47 +01:00
Tom Rini
97962260cb Merge branch 'master_common_h_cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh
- Remove common.h usage
2023-11-02 18:32:57 -04:00
Tom Rini
b0c391ce0c Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
+ CI: Use OpenSBI 1.3.1 release for testing
+ riscv: Support resume after exception
+ rng: Support RNG provided by RISC-V Zkr ISA extension
+ board: starfive VF2: Support jtag
+ board: starfive VF2: Support TRNG driver
+ board: sifive unmatched: Move kernel load address
2023-11-02 09:30:34 -04:00
Paul Barker
32c048bd1d clk: rzg2l: Drop <common.h>
In line with changes elsewhere, drop inclusion of the common header.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2023-11-02 11:30:18 +01:00
Chanho Park
88af85cf92 clk: starfive: jh7110: Add security clocks
Add STGCLK_SEC_HCLK and STGCLK_SEC_MISCAHB clocks for JH7110 TRNG
device.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-11-02 17:45:53 +08:00
Tom Rini
658caf0bf1 Clock changes for 2024.01-rc2
This contains several fixes for the clock core.
 -----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEkGEdW86NSNID6GAoPuiP7LShEG4FAmVCut1fFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkw
 NjExRDVCQ0U4RDQ4RDIwM0U4NjAyODNFRTg4RkVDQjRBMTEwNkUACgkQPuiP7LSh
 EG5TAgf+MtLNjT+HWQAXTNMqC/ey/I0vp/Zo4uU6+tNbs05BbEcInAavoT42Sf2Y
 HMWiviG96wZrN0J5UH+pXzVAh2nrhEXzYX1L054EsJ/R8lHMKvmcxDW/HYoaLeaY
 9A1AseptbJc3UiEtejfUmuBFYdMoLZc+wmqT7iO9yxFFhoBpD9CiSQQVKkcKoI56
 3YKLsTwC4yyTrNr95EM/wILfHu6NOh1cn8fQloVIWD1bGR7qLs7ORcdpbR3Plde3
 iFeTHbJby2cHEn8j84axzs9sqFcc5ZcKXZJ7tKVhu04pjbqHezMOZe9r/vf38NfZ
 6Rf4s4kqRQZKxLBM9ADg/2ocNqEFKA==
 =QToO
 -----END PGP SIGNATURE-----

Merge tag 'clk-2024.01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-clk

Clock changes for 2024.01-rc2

This contains several fixes for the clock core.
2023-11-01 17:49:58 -04:00
Maksim Kiselev
0755db477f clk: use private clk struct in CLK_CCF's enable/disable functions
In clk_enable()/clk_disable() functions, when CCF is activated,
we must pass a private clk struct to enable()/disable() ops functions.
Otherwise, the use of a container_of() construction within these ops
should be banned. Because passing a non-private clk struct to
container_of() results in an out of range error.

At the moment, clk-mux, clk-fixed-factor, clk-gate and possibly other
clocks use container_of() in their enable()/disable() functions.
Therefore, for these functions to work correclty, private clk struct
must be passed.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230905221649.3577929-1-bigunclemax@gmail.com
2023-11-01 15:14:09 -04:00
Eugen Hristev
b6a56f5533 clk: fix count parameter type for clk_release_all
The second parameter for clk_release_all is used as an unsigned
(which makes sense) but the function prototype declares it as an int.
This causes warnings/error like such below:

include/clk.h:422:48: error: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion]
  422 |         return clk_release_all(bulk->clks, bulk->count);

To fix this, changed the type of the count to `unsigned int`

Fixes: 82a8a669b4 ("clk: add clk_release_all()")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230619104752.278500-1-eugen.hristev@collabora.com
2023-11-01 15:13:55 -04:00
Nathan Barrett-Morrison
aed6480fad drivers: clk: Adjust temp var data type to properly match that of struct clk_ops
In commit 5c5992cb90 ("clk: Add debugging for return values"), a
temporary storage variable was added around the ops->get_rate() call
inside clk_get_rate(), so that the result could be passed through
log_ret.

This temporary variable was declared as an int, yet when we look in
struct clk_ops, we can see this needs to be a ulong:
ulong (*get_rate)(struct clk *clk);

This was resulting in a signed to unsigned casting error on our
builds, where a clock value of 0xABCDABCD was being incorrectly cast
to 0xFFFFFFFFABCDABCD.

Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230515195005.1961495-1-nathan.morrison@timesys.com
2023-11-01 15:13:15 -04:00
Vishal Mahaveer
57f9b25547 clk: ti: k3-pll: Add calibration support for non fractional mode
PLL calibration needs to be enabled when operating in non fractional
mode. Add the sequence to do a fast calibration when using PLL
in this mode.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
2023-10-31 13:08:10 -04:00
Tom Rini
5cab3515f8 Merge tag 'u-boot-rockchip-20231024' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
- Add Board: rk3588 NanoPC-T6, Orange Pi 5, Orange Pi 5 Plus;
- clk driver fix for rk3568 and rk3588;
- rkmtd cmd support for rockchip nand device;
- dts update and sync from linux;
2023-10-24 09:39:52 -04:00
Elaine Zhang
6bfb37e702 clk: rockchip: rk3588: fix up the frac pll calculation
rk3588 frac pll:
FFVCO = ((m + k / 65536) * FFIN) / p
FFOUT = ((m + k / 65536) * FFIN) / (p * 2s)
k is the original code, but the K[15:0] is complement code
(6'b1000_0000_0000_0000 <= K[15:0] <= 16'b0111_1111_1111_1111),
need to be converted.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-23 18:21:55 +08:00
Elaine Zhang
e4916e2c66 clk: rockchip: rk3588: Avoid re-setting the pll rate of dclk_vop's parent
Optimize setting process.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-23 18:21:55 +08:00
Elaine Zhang
cdf21a8696 clk: rockchip: rk3588: support aclk_top_root set 750M
aclk_top_root choose a parent clock that does not change.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-23 18:21:55 +08:00
Guochun Huang
39fb8acac4 clk: rk3588: Add 742.5M parameter for PLL
For a specific frequency.

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-23 18:21:55 +08:00
Elaine Zhang
bdb35a2863 clk: rockchip: rk3568: support dclk_vop select more parent clks
For dclk_vop to support more frequencies.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-23 18:21:55 +08:00
Andre Przywara
95168d77d3 sunxi: add Allwinner R528/T113 SoC support
This adds the remaining code bits to teach U-Boot about Allwinner's
newest SoC generation. This was introduced with the RISC-V based
Allwinner D1 SoC, which actually shares a die with the ARM cores versions
called R528 (BGA, without DRAM) and T113s (QFP, with embedded DRAM).

This adds the new Kconfig stanza, using the two newly introduced symbols
for the new SoC generation and pincontroller. It also adds the new symbols
to the relavent code places, to set all the hardcoded bits directly.

We need one DT override:
The ARM core version of the DT specifies the CPUX watchdog as
"reserved", which means it won't be recognised by U-Boot. Override this
in our generic sunxi-u-boot.dtsi, to let U-Boot pick up this watchdog,
so that the generic reset driver will work.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-10-22 23:41:52 +01:00
Samuel Holland
b9a91b98e8 clk: sunxi: Add support for the D1 CCU
Since the D1 CCU binding is defined, we can add support for its
gates/resets, following the pattern of the existing drivers.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-10-22 23:41:51 +01:00
Tom Rini
e65b5d35c9 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
- RZ/G2L part 1, except for two serial port patches which I had to drop
  as they broke R2Dplus, they will come later via subsequent PR.
2023-10-17 09:15:56 -04:00
Tom Rini
c41df16b27 u-boot-imx-20231016
-------------------
 
 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/18168
 
 - Imrovement MX93
 - Toradex: fixes
 - Convert to DM (serial, watchdog) for some boards
 - HAB improvements for Secure Boot
 - DTO overlay for DHCOM
 - USB fixes, Mass storage for MX28
 - Cleanup some code
 - Phytec MX8M : EEProm detection, fixes
 - Gateworks Boards improvements
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQS2TmnA27QKhpKSZe309WXkmmjvpgUCZS2rbg8cc2JhYmljQGRl
 bnguZGUACgkQ9PVl5Jpo76ZdfQCgi+D4n5iiQglY1zy34TkQogK1b/wAoI/8yu79
 SxE769moFjYPyYOZMjtt
 =GGb5
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-20231016' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20231016
-------------------

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/18168

- Imrovement MX93
- Toradex: fixes
- Convert to DM (serial, watchdog) for some boards
- HAB improvements for Secure Boot
- DTO overlay for DHCOM
- USB fixes, Mass storage for MX28
- Cleanup some code
- Phytec MX8M : EEProm detection, fixes
- Gateworks Boards improvements
2023-10-16 17:34:38 -04:00
Paul Barker
1918ff5c95 clk: renesas: Add RZ/G2L & RZ/G2LC CPG driver
This driver provides clock and reset control for the Renesas R9A07G044L
(RZ/G2L) and R9A07G044C (RZ/G2LC) SoC. It consists of two parts:

* driver code which is applicable to all SoCs in the RZ/G2L family.

* static data describing the clocks and resets which are specific to the
  R9A07G044{L,C} SoCs. The identifier r9a07g044 (without a final letter)
  is used to indicate that both SoCs are supported.

clk_set_rate() and clk_get_rate() are implemented only for the clocks
that are actually used in u-boot.

The CPG driver is marked with DM_FLAG_PRE_RELOC to ensure that its bind
function is called before the SCIF (serial port) driver is probed. This
is required so that we can de-assert the relevant reset signal during
the serial driver probe function.

This patch is based on the corresponding Linux v6.5 driver
(commit 52e12027d50affbf60c6c9c64db8017391b0c22e).

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-16 15:46:18 +02:00
Tom Rini
2e1577e836 - add Amlogic A1 clock driver
- add Amlogic A1 reset support
 - add USB Device support for Amlogic A1
 - enable RNG on Amlogic A1 & Amlogic S4
 - move Amlogic Secure Monitor to standalone driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmUrvwIACgkQd9zb2sjI
 SdFhpRAAjJQXAE72iRoAii47hoYY/qhWAHZUe0tlu7lUFbhGRTTISukh3pZ48WCu
 ZXLgIUa30eXzGGa9eItmkt+cH2UuXWOPurQBILXOh/20eCrke47Y41rBfjmfcrWi
 UCDcf7BUojnCnC3zaSDNqUvJtsZvMwep3bjcPFstxZIzdZUML4VcwPNWClVhLABU
 uA5reiJjMiRVrAYp4LDJ1rrG8VgTdEbGt8+E4jPzQRvLfzYC3378SelxNW7UCxfK
 g88CHDNbWWPReiq71ylmKSSiN1TwnbbEjCmVVnv4DwPV8azwR0FkXJcebcpm4myP
 ckrjcb31hIiSEMNTbipytAZtW8qFAsidxuzRY8aEuTrsN+j1cM3QhmZNDUmASYgo
 r0pmkOiGUHFMFFMNXI2g5apJ4vIJfjHo+14TKoTLi+0xj8DqI0bnw5gGnrI6DlGv
 Dk/pOxvjPiiY/3JYxed3LzK3b1vKng4CMLzBp8GvQOZrINNGhFYo9ycML44EUwUs
 QVTW31GJEcuzoYlqV2e1JudGteUG3aoJ3QWW7aAcsG9+nHPHy9nslIcCOAgBA8Ja
 XiB5Z4bcRmTA9XRU93hkc2/rnyeNdsbyCBuqTswmVxsKn+/g5E+1qMG38OPJ9yot
 jVMIxCb6fOEmJIXnfD0FnNLRTySfCLCaS2dZVHIjoYCfLCOI1vk=
 =MjfD
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20231015' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- add Amlogic A1 clock driver
- add Amlogic A1 reset support
- add USB Device support for Amlogic A1
- enable RNG on Amlogic A1 & Amlogic S4
- move Amlogic Secure Monitor to standalone driver
2023-10-16 09:09:54 -04:00