arm: cmsis: Convert relocate_vector_table to use CMSIS
Replace _scs_relocate_vector_table with direct CMSIS register access and use of __ISB/__DSB routinues. We also cleanup the code a little bit to just have one implentation of relocate_vector_table() on ARMv7-M. Jira: ZEP-1568 Change-Id: I088c30e680a7ba198c1527a5822114b70f10c510 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
7f5dc1ab30
commit
6782c3ea23
2 changed files with 6 additions and 40 deletions
|
@ -27,19 +27,16 @@
|
|||
static inline void relocate_vector_table(void) { /* do nothing */ }
|
||||
#elif defined(CONFIG_ARMV7_M)
|
||||
#ifdef CONFIG_XIP
|
||||
static inline void relocate_vector_table(void)
|
||||
{
|
||||
/* vector table is located at the the beginning of the flash */
|
||||
_scs_relocate_vector_table((void *)(CONFIG_FLASH_BASE_ADDRESS +
|
||||
CONFIG_TEXT_SECTION_OFFSET));
|
||||
}
|
||||
#define VECTOR_ADDRESS (CONFIG_FLASH_BASE_ADDRESS + CONFIG_TEXT_SECTION_OFFSET)
|
||||
#else
|
||||
#define VECTOR_ADDRESS CONFIG_SRAM_BASE_ADDRESS
|
||||
#endif
|
||||
static inline void relocate_vector_table(void)
|
||||
{
|
||||
/* vector table is already in SRAM, just point to it */
|
||||
_scs_relocate_vector_table((void *)CONFIG_SRAM_BASE_ADDRESS);
|
||||
SCB->VTOR = VECTOR_ADDRESS & SCB_VTOR_TBLOFF_Msk;
|
||||
__DSB();
|
||||
__ISB();
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#error Unknown ARM architecture
|
||||
#endif /* CONFIG_ARMv6_M */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue