diff --git a/sw/include/car_util.h b/sw/include/car_util.h index 99945ff0..edbc08a2 100644 --- a/sw/include/car_util.h +++ b/sw/include/car_util.h @@ -204,6 +204,10 @@ void car_disable_domain(enum car_rst rst) car_set_isolate(rst, CAR_ISOLATE_ENABLE); } +// Init clock after PoR. Define if required (for PLL configuration, clk mux selection signals, clk +// dividers division values, etc) +void car_clk_init(void) __attribute__((weak)); + // 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 @@ -225,6 +229,7 @@ void car_enable_all_domains() void car_init_start() { + car_clk_init(); car_enable_all_domains(); } diff --git a/sw/sw.mk b/sw/sw.mk index d8b9eb76..e001e686 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 $@ $^