From 827acf4770a1943f14b535dfd876b99ec05118a7 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sun, 15 Oct 2017 01:14:05 +0100 Subject: [PATCH] Implement common early-stage init for all CC2538-based platforms --- arch/cpu/cc2538/soc.c | 18 +++++++++++++++++- arch/cpu/cc2538/soc.h | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/cpu/cc2538/soc.c b/arch/cpu/cc2538/soc.c index a9d8868dd..fc79a2441 100644 --- a/arch/cpu/cc2538/soc.c +++ b/arch/cpu/cc2538/soc.c @@ -38,6 +38,10 @@ #include "contiki.h" #include "dev/rom-util.h" #include "dev/sys-ctrl.h" +#include "dev/ioc.h" +#include "dev/nvic.h" +#include "dev/sys-ctrl.h" +#include "lpm.h" #include "reg.h" #include "soc.h" @@ -104,5 +108,17 @@ soc_print_info(void) sys_ctrl_get_io_clock(), sys_ctrl_get_reset_cause_str()); } - +/*----------------------------------------------------------------------------*/ +void +soc_init() +{ + nvic_init(); + ioc_init(); + sys_ctrl_init(); + clock_init(); + lpm_init(); + rtimer_init(); + gpio_init(); +} +/*----------------------------------------------------------------------------*/ /** @} */ diff --git a/arch/cpu/cc2538/soc.h b/arch/cpu/cc2538/soc.h index 9edee8c37..4b1fad7ee 100644 --- a/arch/cpu/cc2538/soc.h +++ b/arch/cpu/cc2538/soc.h @@ -77,6 +77,9 @@ uint32_t soc_get_features(void); /** \brief Prints SoC information */ void soc_print_info(void); +/** \brief Common initialisation routine for all CC2538-based platforms */ +void soc_init(void); + /** @} */ #endif /* SOC_H_ */