aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-07-18kbuild: Disallow DTB overlays to built from .dts named source filesRasmus Villemoes
[equivalent to linux commit 81d362732bac] As a follow up to the series allowing DTB overlays to built from .dtso files. Now that all overlays have been renamed, remove the ability to build from overlays from .dts files to prevent any files with the old name from accidental being added. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18test/py: efi_capsule: rename device tree overlay source to .dtsoRasmus Villemoes
Distinguish more clearly between source files meant for producing .dtb from those meant for producing .dtbo. Note that in the linux tree, all device tree overlay sources have been renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit 81d362732bac). So this is also a step towards staying closer to linux with respect to both Kbuild and device tree sources, and eventually eliminating all .dts -> .dtbo instances. This also matches the documentation update done in commit 4fb7e570d6b. Cc: Masahisa Kojima <kojima.masahisa@socionext.com> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18test: overlay: rename overlay source files to .dtsoRasmus Villemoes
Distinguish more clearly between source files meant for producing .dtb from those meant for producing .dtbo. In this case, the files are really meant to be compiled to .dtbo -> .dtbo.S -> .dtbo.o that get embedded in the image, which means that the begin/end symbols generated by the makefile rule changes to __dtbo_ rather than __dtb, so the consuming .c file needs updating, but this should not result in any functional change. Note that in the linux tree, all device tree overlay sources have been renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit 81d362732bac). So this is also a step towards staying closer to linux with respect to both Kbuild and device tree sources. Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18kbuild: Allow DTB overlays to built into .dtbo.S filesRasmus Villemoes
[linux commit 941214a512d8, modified for U-Boot by removing the include of vmlinux.lds.h and replacing STRUCT_ALIGNMENT by 16.] DTB files can be built into the kernel by converting them to assembly files then assembling them into object files. We extend this here for DTB overlays with the .dtso extensions. We change the start and end delimiting tag prefix to make it clear that this data came from overlay files. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18arm64: dts: imx8mp: rename DHCOM SoM overlays to .dtsoRasmus Villemoes
Distinguish more clearly between source files meant for producing .dtb from those meant for producing .dtbo. No functional change, as we currently have rules for producing a foo.dtbo from either foo.dts or foo.dtso. Note that in the linux tree, all device tree overlay sources have been renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit 81d362732bac). So this is also a step towards staying closer to linux with respect to both Kbuild and device tree sources. Cc: Marek Vasut <marex@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Marek Vasut <marex@denx.de>
2024-07-10board: phytec: k3: k3_ddrss_patch: Add ddr phy reg countDominik Haller
Add and use the correct number of ddr phy registers to update the corresponding settings. Fixes: cbf5c99ef317 ("board: phytec: common: Introduce a method to inject DDR timings deltas") Signed-off-by: Dominik Haller <d.haller@phytec.de> Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-10omap3: igep0x00: Switch to the I2C driver modelJavier Martinez Canillas
When building with the igep00x0_defconfig, the following warning is shown: $ make -j $(nproc) ... LD spl/u-boot-spl OBJCOPY spl/u-boot-spl-nodtb.bin SYM spl/u-boot-spl.sym CAT spl/u-boot-spl-dtb.bin COPY spl/u-boot-spl.bin MKIMAGE MLO ===================== WARNING ====================== This board does not use CONFIG_DM_I2C (Driver Model for I2C drivers). Please update the board to use CONFIG_DM_I2C before the v2022.04 release. Failure to update by the deadline may result in board removal. See doc/develop/driver-model/migration.rst for more info. ==================================================== The only reason why I2C is enabled for the IGEP boards is that the TWL4030 driver requires it. But both the TWL4034 and the OMAP I2C controller drivers were converted to the driver model by commits daa69ffe3d4d ("drivers: i2c: omap24xx_i2c: adopt omap_i2c driver to driver model") and fb1b7712ad3f power: make most tps drivers and the twl4030 driver compatible with DM_I2C") respectively. So there's no reason anymore to keep using the I2C legacy API and instead the DM_I2C option could just be enabled. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Enric Balletbo i Serra <eballetbo@gmail.com>
2024-07-10cmd: add resize for FDT in bootelfMaxim Moskalets
In some FDTs, there is not enough free memory to add nodes, so this operation fails. Signed-off-by: Maxim Moskalets <maximmosk4@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-10gpt: allow spaces in partition listMikhail Kshevetskiy
This allows spliting partition list to several lines in environment file ex: -------------------- gpt_partition_list= name=boot1,size=5MiB,start=0x100000; name=boot2,size=5MiB; name=rootfs1,size=70MiB; name=rootfs2,size=70MiB; name=overlay1,size=20MiB; name=overlay2,size=20MiB; name=art,size=4MiB; Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-08Merge patch series "mediatek: cumulative trivial fix for OF_UPSTREAM support"Tom Rini
Christian Marangi <ansuelsmth@gmail.com> says: This is an initial series that have all the initial trivial fixes required for usage of OF_UPSTREAM for the mediatek SoC This also contains the pcie-gen3 driver and the required tphy support driver to make it work. Subsequent series will follow with conversion of the mtk-clk to permit usage of OF_UPSTREAM and upstream clk ID. MT7981, MT7986 and MT7988 migration to upstream clock ID is complete and working on MT7623. Series CI tested with PR: https://github.com/u-boot/u-boot/pull/590
2024-07-08clk: mediatek: mt7986: support alternative compatible for fixed-pllsChristian Marangi
Support alternative compatible for fixed-plls clocks used upstream with the compatible mediatek,mt7986-apmixedsys. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08clk: mediatek: mt7988: support alternative compatible for fixed-pllsChristian Marangi
Support alternative compatible for fixed-plls clocks used upstream with the compatible mediatek,mt7988-apmixedsys. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08pci: mediatek: make pcie-phy optional for gen3Christian Marangi
Set pcie-phy optional for PCIe gen3. MT7988 doesn't require it and making it mandatory prevent the driver to correctly probe. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08pinctrl: mediatek: mt7981: init device before relocationChristian Marangi
Upstream kernel linux define pinctrl for uart0, hence this pin group and pinctrl driver is needed before relocation. Add DM_FLAG_PRE_RELOC flag to init and mute mtk_serial error on early serial init. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08pinctrl: mediatek: add support for gpio-controller property in root nodeChristian Marangi
Add support for gpio-controller property in root pinctrl node. This is to follow upstream linux DTSI that doesn't define the gpio-controller and cells in dedicated nodes. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08clk: mediatek: mt7981: support alternative compatible for fixed-pllsChristian Marangi
Support alternative compatible for fixed-plls clocks used upstream with the compatible mediatek,mt7981-apmixedsys. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08mmc: mediatek: add support for upstream linux clock and propertyChristian Marangi
Add support for upstream linux clock and map U-Boot property to the one use in upstream linux where supported. Also add handling for the use_internal_cd that on upstream is hardcoded enabled on mt7620. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08serial: mediatek: add special handling for highspeed and linux compatChristian Marangi
Upstream linux serial driver use a different logic to setup serial regs. They have 2 interval: - < 115200 we use lowspeed regs and 16 * baud - >= 115200 we use highspeed We currently use force_highspeed property to force usage of highspeed regs even with low baud rate. Add special handling if the upstream compatible is used where we just apply the same interval with anything >= 115200 in highspeed simulating force_highspeed. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08serial: mediatek: add support for bus clock and enable itChristian Marangi
Upstream linux also provide the additional optional bus clock. Add support for it and also enable the baud and bus clock on probe. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08i2c: mediatek: add support for optional arb and pmic clockChristian Marangi
Add support for optional arb and pmic clock for i2c provided in upstream linux DTSI. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2024-07-08net: mediatek: handle alternative name for pn_swap propertyChristian Marangi
Handle alternative name for pn_swap property as upstream linux use mediatek,pnswap. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08spi: mtk_spim: add support for upstream mediatek, spi-ipm compatibleChristian Marangi
Upstream kernel linux use a different compatible mediatek,spi-ipm. Add support for this compatible and add handling for the additional clock similar to how it's done by the upstream driver and handling for all the property enabled by default. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08pci: mediatek: add PCIe controller support for filogic siliconJohn Crispin
Add MediaTek GEN3 PCIe controller support for filogic silicon. This is adapted from the Linux version of the driver. Signed-off-by: John Crispin <john@phrozen.org> [ fix minor problems, fix checkpatch errors ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08phy: phy-mtk-tphy: add support for phy type switchChristian Marangi
Add support for PHY type switch via the mediatek topmisc syscon. This is needed on mt7981 to make the PCIe correctly work and display LinkUp. Follow the same implementation done on Linux kernel with the usage of the mediatek,syscon-type property. Example: u3port0: usb-phy@11e10700 { reg = <0x11e10700 0x900>; clocks = <&topckgen CK_TOP_USB3_PHY_SEL>; clock-names = "ref"; #phy-cells = <1>; mediatek,syscon-type = <&topmisc 0x218 0>; status = "okay"; }; Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08Revert "buildman: Always use the full path in CROSS_COMPILE"Tom Rini
There are operations in buildman that result in running the cross-tools (such as performing size checks) and now that we have not modified PATH to know where our tools are, these operations fail. This reverts commit 6c0a3cf75f72370deec3ee516a9dd377397af207. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-08Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- Add mvebu_espressobin_ultra-88f3720_defconfig (Benjamin) - Update DTS for Thecus N2350 board (Tony) - Add "old" Marvell DDR3 training for Armada 38x and Turris Omnia (Marek) - Misc turris_omnia changes (Marek)
2024-07-08Merge tag 'u-boot-imx-master-20240706' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/21504 - Fixes for i.MX8M and i.MX93 clk-composite. - Set CAN oscillator frequency based on model on verdin-imx8mm. - Enable CAAM for phycore-imx8mp_defconfig. - Miscellaneous improvements for Gateworks i.MX8M boards. - Fix initramfs boot on msc_sm2s_imx8mp. - Fixe EQoS on imx8mp-beacon-kit. - Fix error message in fsl_esdhc_imx.
2024-07-08Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usbTom Rini
2024-07-08Merge branch 'next-clk-sync' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-sh
2024-07-08mvebu: armada-8k: respect CONFIG_DISTRO_DEFAULTSRobert Marko
Currently, Armada 8k config header is setting boot devices and including <config_distro_bootcmd.h> regardless of the CONFIG_DISTRO_DEFAULTS being enabled or not, thus populating the environment for distro boot even on devices that have no need for it. So, lets simply respect the value of CONFIG_DISTRO_DEFAULTS. Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-08arm: mvebu: turris_omnia: Support old DDR3 trainingMarek Behún
Support old DDR3 training code on Turris Omnia, selectable via EEPROM field. Users experiencing DDR3 initialization failures or random crashes of the operating system due to incorrect DDR3 configuration can select the old DDR3 training implementation to fix those issues by setting the EEPROM field "Use old DDR training": eeprom update "Use old DDR training" 1 Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: a38x: Add optional support for using old DDR3 training codeMarek Behún
Add optional support for using old DDR3 training code from 2017. The code lives in drivers/ddr/marvell/a38x/old/. To prevent symbol clashing with new DDR3 training code, a special header which renames all clashing symbols via macros is included and the symbols are prefixed with 'old_'. If old DDR3 training support is selected for a board, then the SPL initialization code calls a new function board_use_old_ddr3_training() to check whether it should use old DDR3 training code. The default weak implementation returns false, defaulting to new DDR3 training code. Boards that wish to support this need to select the ARMADA_38X_SUPPORT_OLD_DDR3_TRAINING config option and implement the old version of DDR topology provider, ddr3_get_topology_map(). Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: old: Backport immutable debug settingsMarek Behún
Backport the option to compile with immutable debug settings also to the old implementation of the DDR3 training code. The original PR for mv-ddr-marvell can be seen at https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/45/ Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: old: Fix some compiler warning of the old codeMarek Behún
Fix some compilation warning in the old DDR training code. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: Import old DDR training code from 2017 version of U-BootMarek Behún
Import DDR training code from commit 1b69ce2fc0ec ("arm: mvebu: ddr3_debug: remove self assignments") into drivers/ddr/marvell/a38x/old/. The code is not used yet. Explanation: Since 2019, on some Turris Omnia boards we have been having problems with newer versions of Marvell's DDR3 training code for Armada 38x, which is ported from mv-ddr-marvell [1] to U-Boot into the drivers/ddr/marvell/a38x/ directory: - sometimes the DDR3 training fails on some older boards, sometime it fails on some newer boards - other times it succeeds, but some boards experience crashes of the operating system after running for some time. Using the stock version of Turris Omnia's U-Boot from solved these issues, but this solution was not satisfactory, since we wanted features from new U-Boot. Back in 2020-2022 we have spent several months trying to debug the issues, working with Marvell, on our own, and also with U-Boot community, but these issues persist still. One solution we used back in 2019 was a "hybrid U-Boot": the SPL part (containing the DDR3 training code) was taken from the stock version, while the proper part was current U-Boot at the time. This solution also has its drawbacks, of which the main one is the need to glue binaries from two separate builds. Since then there have been some more changes to the DDR3 training code in upstream mv-ddr-marvell that have been ported to U-Boot. We have provided our users experimental builds of U-Boot in the TurrisOS so that they could try upgrading the firmware and let us know if those problems still exist. And they do. We do not have the time nor manpower to debug this problem and fix it properly. Marvell was also no able to provide a solution to this, probably because they do not have the manpower as well. I have therefore come up with this "not that pretty" solution: take the DDR3 training code from an older version of U-Boot that is known to work, put it into current U-Boot under old/ subdirectory within drivers/ddr/marvell/a38x/, build into the SPL binary both the old and new versions and make it possible to select the old version via an env variable. [1] https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Read DDR speed from EEPROMMarek Behún
Some Turris Omnia boards experience memory issues, and by experimentation we found that some of these issues can be solved by slowing DDR speed. Add a new field in the extended EEPROM information structure, ddr_speed. Support several values in this field (for now 1066F, 1333H, and the default, 1600K) and use it to overwrite the DDR topology parameters used by the DDR training algorithm. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Extend EEPROM info structureMarek Behún
Extend the Omnia EEPROM information structure in preparation for more variables to be stored there. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Enable the 'eeprom' commandMarek Behún
Enable the 'eeprom' command with support for EEPROM layout for Turris Omnia. Enable the i2c-eeprom driver so that the EEPROM is accessed via driver model. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Implement EEPROM layout for the 'eeprom' commandMarek Behún
Implement Turris Omnia EEPROM layout for the 'eeprom' command. When the 'eeprom' command (with layout support) is enabled, we can now use the 'eeprom print' and 'eeprom update' commands, for example: => eeprom print Magic constant 34a04103 RAM size in GB 2 Wi-Fi Region CRC32 checksum cecbc2a1 Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Fix ethernet PHY reset gpio FDT fixupMarek Behún
For board revisions where the WAN ethernet PHY reset GPIO is controllable via MCU we currently insert a phy-reset-gpios property into the ethernet controller node. The mvneta driver parses this property and uses the GPIO to reset the PHY. But this phy-reset-gpios property is not a valid DT binding in upstream kernel. Instead, a reset-gpios property should be inserted into the ethernet PHY node. This correct DT binding is supported by the DM ETH PHY U-Boot driver. Insert the reset-gpios property into the WAN PHY node instead the phy-reset-gpios property in WAN ETH node so that Linux will correctly use the reset GPIO. Enable the CONFIG_DM_ETH_PHY config option so that U-Boot will also use the correct DT property. Note: currently there are 4 ethernet controller drivers parsing the wrong DT property: dwc_eth_qos, fex_mxc, mvneta and mvpp2. We should convert all relevant device-trees to use reset-gpios so that we can get rid of these drivers parsing this property. Fixes: 1da53ae26afc ("arm: mvebu: turris_omnia: Add support for design with SW reset signals") Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Enable immutable debug settings in DDR3 training ↵Marek Behún
by default Save 10 KiB in Turris Omnia's SPL binary by enabling immutable debug settings for DDR3 training code. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: debug: Allow compiling with immutable debug settings to ↵Marek Behún
reduce binary size Allow compiling with immutable debug settings: - DEBUG_LEVEL is always set to DEBUG_LEVEL_ERROR - register dumps are disabled This can save around 10 KiB of space in the resulting binary, which is a lot in U-Boot SPL. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: debug: Define DDR_VIEWER_TOOL variables only if needed, ↵Marek Behún
and make them static The variables is_validate_window_per_if, is_validate_window_per_pup, sweep_cnt and is_run_leveling_sweep_tests are only used if DDR_VIEWER_TOOL macro is defined, so define them only in that case. Make them static since they are only used in ddr3_debug.c. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: debug: Remove unused variablesMarek Behún
The variables is_default_centralization, is_tune_result and is_bist_reset_bit are never used. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08ddr: marvell: a38x: debug: return from ddr3_tip_print_log() early if we ↵Marek Behún
won't print anything Return from ddr3_tip_print_log() early if we won't print anything anyway. This way the compiler can optimize away the VALIDATE_IF_ACTIVE() calls in the for-loop, so if the SILENT_LIB macro is defined, no code is generated for the rest of the function, which saves some space. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: mvebu: turris_omnia: Disable ext4 write support in defconfigMarek Behún
Turris Omnia defconfig is nearing image size limit. Disable ext4 write support to reserve space for more important stuff. This reduces the size of the KWB image by ~19 KiB. If in the future U-Boot supports compressing itself and decompressing on load, we may enable this again. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-07-08arm: dts: mvebu: Update DTS for Thecus N2350 boardTony Dinh
- Change the spi-max-frequency to 50000000 (50 Mhz). According to the data sheet[1], the MX25L3205D max frequency is 86 Mhz. Using 50 Mhz in the DTS to ensure u-boot is consistent with what Linux kernel expected. - Update GPIO fan to conform to the latest DT binding. [1] https://www.macronix.com/Lists/Datasheet/Attachments/8575/MX25L3205D,%203V,%2032Mb,%20v1.5.pdf Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2024-07-08arm: mvebu: env_sf_get_env_addr() missing check for CONFIG_ENV_IS_IN_SPI_FLASHTony Dinh
The CONFIG_ENV_OFFSET is undefined if boot device is UART (CONFIG_MVEBU_SPL_BOOT_DEVICE_UART), or envs are not stored on flash (CONFIG_ENV_IS_NOWHERE). Check for CONFIG_ENV_IS_IN_SPI_FLASH as the first condition to determine whether env_sf_get_env_addr() should be provided. Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2024-07-08configs: add mvebu_espressobin_ultra-88f3720_defconfigBenjamin Schneider
Add support for a Marvell Armada 3720 device variant Signed-off-by: Benjamin Schneider <ben@bens.haus>
2024-07-06clk: imx: add mux ops for i.MX8M composite clkMichael Trimarchi
Upstream Linux commit f90b68d6c8b0. The CORE/BUS root slice has following design, simplied graph: The difference is core not have pre_div block. A composite core/bus clk has 8 inputs for mux to select, saying clk[0-7]. It support target(smart) interface and normal interface. Target interface is exported for programmer easy to configure ccm root. Normal interface is also exported, but we not use it in our driver, because it will introduce more complexity compared with target interface. The normal interface simplified as below: SEL_A GA +--+ +-+ | +->+ +------+ CLK[0-7]--->+ | +-+ | | | | +----v---+ +----+ | +--+ |pre_diva+----> | +---------+ | +--------+ |mux +--+post_div | | +--+ |pre_divb+--->+ | +---------+ | | | +----^---+ +----+ +--->+ | +-+ | | +->+ +------+ +--+ +-+ SEL_B GB The mux in the upper pic is not the target interface MUX, target interface MUX is hiding SEL_A and SEL_B. When you choose clk[0-7], you are actually writing SEL_A or SEL_B depends on the internal counter which will also control the internal "mux". The target interface simplified as below which is used by Linux Kernel: CLK[0-7]--->MUX-->Gate-->pre_div-->post_div A requirement of the Target Interface's software is that the target clock source is active, it means when setting SEL_A, the current input clk to SEL_A must be active, same to SEL_B. We touch target interface, but hardware logic actually also need configure normal interface. There will be system hang, when doing the following steps: The initial state: SEL_A/SEL_B are both sourcing from clk0, the internal counter choose SEL_A. 1. switch mux from clk0 to clk1 The hardware logic will choose SEL_B and configure SEL_B to clk1. SEL_A no changed. 2. gate off clk0 Disable clk0, then the input to SEL_A is off. 3. switch from clk1 to clk2 The hardware logic will choose SEL_A and configure SEL_A to clk2, however the current SEL_A input clk0 is off, the system hang. The solution to fix the issue is in step 1, write twice to target interface MUX, it will make SEL_A/SEL_B both sources from clk1, then no need to care about the state of clk0. And finally system performs well. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>