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:
parent
8e4c588eab
commit
6f91fd858c
9 changed files with 32 additions and 42 deletions
|
@ -1,2 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
zephyr_include_directories(.)
|
|
|
@ -5,5 +5,3 @@ if(CONFIG_UART_GECKO)
|
||||||
zephyr_library()
|
zephyr_library()
|
||||||
zephyr_library_sources(board.c)
|
zephyr_library_sources(board.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
zephyr_include_directories(.)
|
|
||||||
|
|
|
@ -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 */
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Copyright (c) 2021 Sateesh Kotapati
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
zephyr_library()
|
|
||||||
zephyr_library_sources(board.c)
|
|
|
@ -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 */
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <dt-bindings/i2c/i2c.h>
|
#include <dt-bindings/i2c/i2c.h>
|
||||||
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
|
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
|
||||||
#include <dt-bindings/adc/adc.h>
|
#include <dt-bindings/adc/adc.h>
|
||||||
|
#include <freq.h>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
|
@ -17,6 +18,15 @@
|
||||||
zephyr,entropy = &trng;
|
zephyr,entropy = &trng;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clocks {
|
||||||
|
clk_hfxo: clk-hfxo {
|
||||||
|
#clock-cells = <0>;
|
||||||
|
compatible = "silabs,hfxo";
|
||||||
|
clock-frequency = <DT_FREQ_K(38400)>;
|
||||||
|
ctune = <120>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
cpus {
|
cpus {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <dt-bindings/i2c/i2c.h>
|
#include <dt-bindings/i2c/i2c.h>
|
||||||
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
|
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
|
||||||
#include <dt-bindings/adc/adc.h>
|
#include <dt-bindings/adc/adc.h>
|
||||||
|
#include <freq.h>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
|
@ -17,6 +18,15 @@
|
||||||
zephyr,entropy = &se;
|
zephyr,entropy = &se;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clocks {
|
||||||
|
clk_hfxo: clk-hfxo {
|
||||||
|
#clock-cells = <0>;
|
||||||
|
compatible = "silabs,hfxo";
|
||||||
|
clock-frequency = <DT_FREQ_M(39)>;
|
||||||
|
ctune = <140>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
cpus {
|
cpus {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
|
|
9
dts/bindings/clock/silabs,hfxo.yaml
Normal file
9
dts/bindings/clock/silabs,hfxo.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
compatible: "silabs,hfxo"
|
||||||
|
|
||||||
|
include: fixed-clock.yaml
|
||||||
|
|
||||||
|
properties:
|
||||||
|
ctune:
|
||||||
|
type: int
|
||||||
|
required: true
|
||||||
|
description: Load capacitance configuration
|
|
@ -7,12 +7,10 @@
|
||||||
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
|
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
|
||||||
#define 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_MODE cmuHfxoOscMode_Crystal
|
||||||
#define SL_DEVICE_INIT_HFXO_FREQ 39000000
|
#define SL_DEVICE_INIT_HFXO_FREQ DT_PROP(DT_NODELABEL(clk_hfxo), clock_frequency)
|
||||||
#define SL_DEVICE_INIT_HFXO_CTUNE 140
|
#define SL_DEVICE_INIT_HFXO_CTUNE DT_PROP(DT_NODELABEL(clk_hfxo), ctune)
|
||||||
|
|
||||||
#endif /* CONFIG_BOARD_EFR32_RADIO_BRD4187C */
|
|
||||||
|
|
||||||
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */
|
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */
|
Loading…
Add table
Add a link
Reference in a new issue