]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: imx: imx8mq: add support to get values for more clocks
authorHeiko Thiery <heiko.thiery@gmail.com>
Thu, 9 Sep 2021 12:59:18 +0000 (14:59 +0200)
committerStefano Babic <sbabic@denx.de>
Sat, 5 Feb 2022 12:38:38 +0000 (13:38 +0100)
Return the root clock values for MXC_CSPI_CLK, MXC_I2C_CLK,
MXC_UART_CLK and MXC_QSPI_CLK.

At least for the I2C clock the missing support leads to a wrong
configured I2C frequency. The expected value is 100kHz but the resulting
value is about 1MHz.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
arch/arm/mach-imx/imx8m/clock_imx8mq.c

index 60e2218a3ccc3fc7fac128fcfcd8e561a5dba028..9db62b944e4cb9e89157b01b23ce662c7f07e912 100644 (file)
@@ -359,10 +359,18 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
                clock_get_target_val(IPG_CLK_ROOT, &val);
                val = val & 0x3;
                return get_root_clk(AHB_CLK_ROOT) / (val + 1);
+       case MXC_CSPI_CLK:
+               return get_root_clk(ECSPI1_CLK_ROOT);
        case MXC_ESDHC_CLK:
                return get_root_clk(USDHC1_CLK_ROOT);
        case MXC_ESDHC2_CLK:
                return get_root_clk(USDHC2_CLK_ROOT);
+       case MXC_I2C_CLK:
+               return get_root_clk(I2C1_CLK_ROOT);
+       case MXC_UART_CLK:
+               return get_root_clk(UART1_CLK_ROOT);
+       case MXC_QSPI_CLK:
+               return get_root_clk(QSPI_CLK_ROOT);
        default:
                return get_root_clk(clk);
        }