From bcccdacc7e7b7b985df942b3fae26cb9038a2574 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 1 Jul 2019 08:59:24 +0200 Subject: [PATCH] feat(st-clock): manage disabled oscillator Support "disabled" status for oscillator in device tree. At boot time, the clock tree initialization performs the following tasks: - enabling of the oscillators present in the device tree and not disabled, - disabling of the HSI oscillator if the node is absent or disabled (always activated by bootROM). Signed-off-by: Patrick Delaunay Change-Id: I176276022334f3d97ba0250b54062f0ae970e239 --- drivers/st/clk/stm32mp_clkfunc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/st/clk/stm32mp_clkfunc.c b/drivers/st/clk/stm32mp_clkfunc.c index c83b8ad05..e008bc2cf 100644 --- a/drivers/st/clk/stm32mp_clkfunc.c +++ b/drivers/st/clk/stm32mp_clkfunc.c @@ -1,19 +1,18 @@ /* - * Copyright (c) 2017-2021, STMicroelectronics - All Rights Reserved + * Copyright (c) 2017-2022, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: BSD-3-Clause */ #include -#include - -#include - #include #include #include #include +#include + +#include #define DT_UART_COMPAT "st,stm32h7-uart" /* @@ -45,7 +44,8 @@ int fdt_osc_read_freq(const char *name, uint32_t *freq) return ret; } - if (strncmp(cchar, name, (size_t)ret) == 0) { + if ((strncmp(cchar, name, (size_t)ret) == 0) && + (fdt_get_status(subnode) != DT_DISABLED)) { const fdt32_t *cuint; cuint = fdt_getprop(fdt, subnode, "clock-frequency", -- 2.39.5