aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-06-22 07:51:40 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-06-22 07:51:40 +0000
commitcb5dc8279181e6e5554d48f7495fa12841354b4b (patch)
tree2d258651abdf6aa9cc50579c5b34f5b5282de061 /os/hal
parent83da11cab02e6e366ab1ed5913d0db70058ef4d6 (diff)
downloadChibiOS-cb5dc8279181e6e5554d48f7495fa12841354b4b.tar.gz
ChibiOS-cb5dc8279181e6e5554d48f7495fa12841354b4b.tar.bz2
ChibiOS-cb5dc8279181e6e5554d48f7495fa12841354b4b.zip
Added eMIOS global prescaler setting to SPC563Mxx and SPC564Axx devices HAL.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5867 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/platforms/SPC563Mxx/hal_lld.c3
-rw-r--r--os/hal/platforms/SPC563Mxx/hal_lld.h16
-rw-r--r--os/hal/platforms/SPC564Axx/hal_lld.c3
-rw-r--r--os/hal/platforms/SPC564Axx/hal_lld.h16
4 files changed, 38 insertions, 0 deletions
diff --git a/os/hal/platforms/SPC563Mxx/hal_lld.c b/os/hal/platforms/SPC563Mxx/hal_lld.c
index 22979e61b..5eb36bdd4 100644
--- a/os/hal/platforms/SPC563Mxx/hal_lld.c
+++ b/os/hal/platforms/SPC563Mxx/hal_lld.c
@@ -95,6 +95,9 @@ void hal_lld_init(void) {
INTC.CPR.R = 0;
INTC.IACKR.R = (uint32_t)_vectors;
+ /* eMIOS initialization.*/
+ EMIOS.MCR.R = (1U << 26) | SPC5_EMIOS_GPRE; /* GPREN and GPRE. */
+
/* EDMA initialization.*/
edmaInit();
}
diff --git a/os/hal/platforms/SPC563Mxx/hal_lld.h b/os/hal/platforms/SPC563Mxx/hal_lld.h
index eec53fd5a..705b94201 100644
--- a/os/hal/platforms/SPC563Mxx/hal_lld.h
+++ b/os/hal/platforms/SPC563Mxx/hal_lld.h
@@ -169,6 +169,13 @@
BIUCR_BFEN)
#endif
+/**
+ * @brief eMIOS global prescaler value.
+ */
+#if !defined(SPC5_EMIOS_GPRE_VALUE) || defined(__DOXYGEN__)
+#define SPC5_EMIOS_GPRE_VALUE 20
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -193,6 +200,10 @@
#error "invalid SPC5_CLK_RFD value specified"
#endif
+#if (SPC5_EMIOS_GPRE_VALUE < 1) || (SPC5_EMIOS_GPRE_VALUE > 256)
+#error "invalid SPC5_EMIOS_GPRE_VALUE value specified"
+#endif
+
/**
* @brief PLL input divider.
*/
@@ -239,6 +250,11 @@
#define SPC5_FLASH_WS (BIUCR_APC_3 | BIUCR_RWSC_3 | BIUCR_WWSC_1)
#endif
+/**
+ * @brief eMIOS global prescaler setting.
+ */
+#define SPC5_EMIOS_GPRE (SPC5_EMIOS_GPRE_VALUE << 8)
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.c b/os/hal/platforms/SPC564Axx/hal_lld.c
index f6b220c85..4c665ee25 100644
--- a/os/hal/platforms/SPC564Axx/hal_lld.c
+++ b/os/hal/platforms/SPC564Axx/hal_lld.c
@@ -107,6 +107,9 @@ void hal_lld_init(void) {
INTC.CPR.R = 0;
INTC.IACKR.R = (uint32_t)_vectors;
+ /* eMIOS initialization.*/
+ EMIOS.MCR.R = (1U << 26) | SPC5_EMIOS_GPRE; /* GPREN and GPRE. */
+
/* EDMA initialization.*/
edmaInit();
}
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.h b/os/hal/platforms/SPC564Axx/hal_lld.h
index 62df1df45..093400f7b 100644
--- a/os/hal/platforms/SPC564Axx/hal_lld.h
+++ b/os/hal/platforms/SPC564Axx/hal_lld.h
@@ -169,6 +169,13 @@
BIUCR_BFEN)
#endif
+/**
+ * @brief eMIOS global prescaler value.
+ */
+#if !defined(SPC5_EMIOS_GPRE_VALUE) || defined(__DOXYGEN__)
+#define SPC5_EMIOS_GPRE_VALUE 20
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -193,6 +200,10 @@
#error "invalid SPC5_CLK_RFD value specified"
#endif
+#if (SPC5_EMIOS_GPRE_VALUE < 1) || (SPC5_EMIOS_GPRE_VALUE > 256)
+#error "invalid SPC5_EMIOS_GPRE_VALUE value specified"
+#endif
+
/**
* @brief PLL input divider.
*/
@@ -250,6 +261,11 @@
#define SPC5_RAM_WS 0x40000000
#endif
+/**
+ * @brief eMIOS global prescaler setting.
+ */
+#define SPC5_EMIOS_GPRE (SPC5_EMIOS_GPRE_VALUE << 8)
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/