dts: arm: silabs: Configure hfxo in dtsi

This commit moves configuration of hfxo from headers defined on board level
to device trees of SoCs.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
This commit is contained in:
Franciszek Zdobylak 2023-10-03 10:37:10 +02:00 committed by Carles Cufí
commit 6f91fd858c
9 changed files with 32 additions and 42 deletions

View file

@ -1,2 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_include_directories(.)

View file

@ -5,5 +5,3 @@ if(CONFIG_UART_GECKO)
zephyr_library()
zephyr_library_sources(board.c)
endif()
zephyr_include_directories(.)

View file

@ -1,14 +0,0 @@
/*
* Copyright (c) 2022 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal
#define SL_DEVICE_INIT_HFXO_FREQ 38400000
#define SL_DEVICE_INIT_HFXO_CTUNE 120
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */

View file

@ -1,5 +0,0 @@
# Copyright (c) 2021 Sateesh Kotapati
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources(board.c)

View file

@ -1,14 +0,0 @@
/*
* Copyright (c) 2023 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal
#define SL_DEVICE_INIT_HFXO_FREQ 39000000
#define SL_DEVICE_INIT_HFXO_CTUNE 140
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */

View file

@ -10,6 +10,7 @@
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
#include <dt-bindings/adc/adc.h>
#include <freq.h>
/ {
chosen {
@ -17,6 +18,15 @@
zephyr,entropy = &trng;
};
clocks {
clk_hfxo: clk-hfxo {
#clock-cells = <0>;
compatible = "silabs,hfxo";
clock-frequency = <DT_FREQ_K(38400)>;
ctune = <120>;
};
};
cpus {
#address-cells = <1>;
#size-cells = <0>;

View file

@ -10,6 +10,7 @@
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
#include <dt-bindings/adc/adc.h>
#include <freq.h>
/ {
chosen {
@ -17,6 +18,15 @@
zephyr,entropy = &se;
};
clocks {
clk_hfxo: clk-hfxo {
#clock-cells = <0>;
compatible = "silabs,hfxo";
clock-frequency = <DT_FREQ_M(39)>;
ctune = <140>;
};
};
cpus {
#address-cells = <1>;
#size-cells = <0>;

View file

@ -0,0 +1,9 @@
compatible: "silabs,hfxo"
include: fixed-clock.yaml
properties:
ctune:
type: int
required: true
description: Load capacitance configuration

View file

@ -7,12 +7,10 @@
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_CONFIG_H
#ifdef CONFIG_BOARD_EFR32_RADIO_BRD4187C
#include <zephyr/devicetree.h>
#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal
#define SL_DEVICE_INIT_HFXO_FREQ 39000000
#define SL_DEVICE_INIT_HFXO_CTUNE 140
#endif /* CONFIG_BOARD_EFR32_RADIO_BRD4187C */
#define SL_DEVICE_INIT_HFXO_FREQ DT_PROP(DT_NODELABEL(clk_hfxo), clock_frequency)
#define SL_DEVICE_INIT_HFXO_CTUNE DT_PROP(DT_NODELABEL(clk_hfxo), ctune)
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */