summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
Diffstat (limited to 'chip')
-rw-r--r--chip/g/sps.c8
-rw-r--r--chip/g/system.c9
2 files changed, 17 insertions, 0 deletions
diff --git a/chip/g/sps.c b/chip/g/sps.c
index 6d21b06358..0ce1d6be41 100644
--- a/chip/g/sps.c
+++ b/chip/g/sps.c
@@ -9,6 +9,7 @@
#include "pmu.h"
#include "registers.h"
#include "sps.h"
+#include "system.h"
#include "task.h"
#include "timer.h"
#include "watchdog.h"
@@ -238,6 +239,13 @@ int sps_unregister_rx_handler(void)
static void sps_init(void)
{
+ /*
+ * Check to see if slave SPI interface is required by the board before
+ * initializing it. If SPI option is not set, then just return.
+ */
+ if (!(system_get_board_properties() & BOARD_SLAVE_CONFIG_SPI))
+ return;
+
pmu_clock_en(PERIPH_SPS);
/* The pinmux connections are preset, but we have to set IN/OUT */
diff --git a/chip/g/system.c b/chip/g/system.c
index 80b55601d9..7071e2680b 100644
--- a/chip/g/system.c
+++ b/chip/g/system.c
@@ -352,3 +352,12 @@ int system_process_retry_counter(void)
}
#endif
+uint32_t system_get_board_properties(void)
+{
+ uint32_t properties = 0;
+
+#ifdef BOARD_CR50
+ properties = system_board_properties_callback();
+#endif
+ return properties;
+}