Skip to content

Commit c8a2915

Browse files
Phi Tranquytranpzz
authored andcommitted
arch: update fixed vectors for config HOCO frequency.
Add macro to update fixed vectors to configure Hoco frequency via the register OFS1. Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
1 parent 0de6cbf commit c8a2915

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/rx/core/vects.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <zephyr/irq.h>
99
#include <kswap.h>
1010
#include <zephyr/tracing/tracing.h>
11+
#include <zephyr/drivers/clock_control/renesas_rx_cgc.h>
1112

1213
typedef void (*fp)(void);
1314
extern void _start(void);
@@ -24,6 +25,9 @@ extern void z_rx_irq_exit(void);
2425

2526
#define __ISR__ __attribute__((interrupt, naked))
2627

28+
#define SET_OFS1_HOCO_BITS(reg, freq) \
29+
((reg) & ~(0b11 << 12)) | ((((freq) == 24000000 ? 0b10 : (freq) == 32000000 ? 0b11 : (freq) == 48000000 ? 0b01 : (freq) == 64000000 ? 0b00 : 0b11) << 12))
30+
2731
static ALWAYS_INLINE void REGISTER_SAVE(void)
2832
{
2933
__asm volatile(
@@ -421,7 +425,7 @@ const void *FixedVectors[] FVECT_SECT = {
421425
/* Reserved for OFSM */
422426
(fp)0xFFFFFFFF,
423427
(fp)0xFFFFFFFF,
424-
(fp)0xFFFFFFFF,
428+
(fp)(SET_OFS1_HOCO_BITS(0xFFFFFFFF, (RX_CGC_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(hoco), clock_frequency, 32000000)))),
425429
(fp)0xFFFFFFFF,
426430
/* Reserved area */
427431
(fp)0xFFFFFFFF,

0 commit comments

Comments
 (0)