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 <patrick.delaunay@st.com>
Change-Id: I176276022334f3d97ba0250b54062f0ae970e239
This commit is contained in:
Patrick Delaunay 2019-07-01 08:59:24 +02:00 committed by Yann Gautier
parent 964e5ff184
commit bcccdacc7e
1 changed files with 6 additions and 6 deletions

View File

@ -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 <errno.h>
#include <libfdt.h>
#include <platform_def.h>
#include <common/fdt_wrappers.h>
#include <drivers/clk.h>
#include <drivers/st/stm32_gpio.h>
#include <drivers/st/stm32mp_clkfunc.h>
#include <libfdt.h>
#include <platform_def.h>
#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",