File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55 */
66
7+ #include <zephyr/device.h>
78#include <zephyr/platform/hooks.h>
89#include "nrf7120_enga_types.h"
910#include "nrf7120_enga_global.h"
1011
1112#if CONFIG_BOARD_EARLY_INIT_HOOK
12- /* Temporary workaround while VPR does not handle starting LFRC */
13+ /* Temporary workaround while VPR does not handle starting clocks */
1314void board_early_init_hook (void )
1415{
16+ #if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC )
1517 NRF_CLOCK_S -> LFCLK .SRC = CLOCK_LFCLK_SRC_SRC_LFRC ;
18+ #elif DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (lfxo ))
19+ NRF_CLOCK_S -> LFCLK .SRC = CLOCK_LFCLK_SRC_SRC_LFXO ;
20+ #else
21+ NRF_CLOCK_S -> LFCLK .SRC = CLOCK_LFCLK_SRC_SRC_LFSYNT ;
22+ #endif
1623 NRF_CLOCK_S -> TASKS_LFCLKSTART = 1 ;
1724
1825 /* Wait for event */
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y
2424# Start SYSCOUNTER on driver init
2525CONFIG_NRF_GRTC_TIMER_APP_DEFINED_INIT=n
2626CONFIG_NRF_GRTC_START_SYSCOUNTER=y
27- CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
27+
28+ # LFRC is not working in EMU at the moment
29+ # CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
2830
2931# Enable Debugging when working with emulator
3032CONFIG_OUTPUT_DISASSEMBLY=y
Original file line number Diff line number Diff line change 4343 };
4444
4545 clocks {
46+ pclk: pclk {
47+ compatible = "fixed-clock";
48+ #clock-cells = <0>;
49+ clock-frequency = <DT_FREQ_M(16)>;
50+ };
51+
4652 lfxo: lfxo {
4753 compatible = "fixed-clock";
4854 #clock-cells = <0>;
657663 compatible = "nordic,nrf-grtc";
658664 reg = <0xe2000 0x1000>;
659665 cc-num = <16>;
666+ clocks = <&lfxo>, <&pclk>;
667+ clock-names = "lfclock", "hfclock";
660668 status = "disabled";
661669 };
662670
You can’t perform that action at this time.
0 commit comments