From 5fd79a42c9c853054c86b40d195fd708c09e5eaf Mon Sep 17 00:00:00 2001 From: aottaviano Date: Wed, 4 Oct 2023 15:57:27 +0200 Subject: [PATCH 1/2] sw: Add clock init function symbol --- sw/include/car_util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sw/include/car_util.h b/sw/include/car_util.h index 282c47021..e6f23958c 100644 --- a/sw/include/car_util.h +++ b/sw/include/car_util.h @@ -205,6 +205,13 @@ void car_disable_domain(enum car_rst rst) car_set_isolate(rst, CAR_ISOLATE_ENABLE); } +// Provide a default weak implementation to init clock after PoR. Define as strong symbol if +// required (for PLL configuration, clk mux selection signals, clk dividers division values, etc) +__attribute__((weak)) void car_clk_init() +{ + +} + // De-isolate and ungate domains at startup. In non-secure boot mode, only the host domain is // de-isolated and ungated after POR. In secure boot mode, both the host domain and the security // domain are de-isolated and ungated after POR. Note that L2 and peripheral domain are always-on @@ -226,6 +233,7 @@ void car_enable_all_domains() void car_init_start() { + car_clk_init(); car_enable_all_domains(); } From 2f584b347cab5547fdcb2af67dca7e3e80b8a611 Mon Sep 17 00:00:00 2001 From: aottaviano Date: Thu, 5 Oct 2023 18:00:03 +0200 Subject: [PATCH 2/2] sw: Prevent CAR_SW_LIBS overwrite a previous definition --- sw/sw.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/sw.mk b/sw/sw.mk index 52f243c57..07d3e76c4 100644 --- a/sw/sw.mk +++ b/sw/sw.mk @@ -26,7 +26,7 @@ CAR_SW_LIB_SRCS_S = $(wildcard $(CAR_SW_DIR)/lib/*.S $(CAR_SW_DIR)/lib/**/*.S) CAR_SW_LIB_SRCS_C = $(wildcard $(CAR_SW_DIR)/lib/*.c $(CAR_SW_DIR)/lib/**/*.c) CAR_SW_LIB_SRCS_O = $(CAR_SW_DEPS_SRCS:.c=.o) $(CAR_SW_LIB_SRCS_S:.S=.o) $(CAR_SW_LIB_SRCS_C:.c=.o) -CAR_SW_LIBS = $(CAR_SW_DIR)/lib/libcarfield.a +CAR_SW_LIBS += $(CAR_SW_DIR)/lib/libcarfield.a $(CAR_SW_DIR)/lib/libcarfield.a: $(CAR_SW_LIB_SRCS_O) $(CHS_SW_AR) $(CHS_SW_ARFLAGS) -rcsv $@ $^