Skip to content

Commit

Permalink
soc: silabs: siwg917: Use PLL as core clock
Browse files Browse the repository at this point in the history
Use existing CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC to configure PLL
frequency.

Signed-off-by: Aksel Skauge Mellbye <[email protected]>
  • Loading branch information
asmellby committed Aug 9, 2024
1 parent 33432c8 commit 25ec2db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Antmicro
# SPDX-License-Identifier: Apache-2.0

CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=180000000
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
Expand Down
11 changes: 11 additions & 0 deletions soc/silabs/silabs_siwx917/siwg917/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
#include "rsi_rom_clks.h"
#include "rsi_rom_ulpss_clk.h"

#include "sl_si91x_clock_manager.h"

int silabs_siwx917_init(void)
{
SystemInit();
SystemCoreClockUpdate();

/* Use SoC PLL at configured frequency as core clock */
sl_si91x_clock_manager_m4_set_core_clk(M4_SOCPLLCLK,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC);

/* Use interface PLL at configured frequency as peripheral clock */
sl_si91x_clock_manager_set_pll_freq(INFT_PLL,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
PLL_REF_CLK_VAL_XTAL);

/* FIXME: do not hardcode UART instances */
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ulpuart0), okay)
RSI_ULPSS_UlpUartClkConfig(ULPCLK, ENABLE_STATIC_CLK, 0, ULP_UART_ULP_32MHZ_RC_CLK, 1);
Expand Down

0 comments on commit 25ec2db

Please sign in to comment.