Skip to content

Commit d1d6fa7

Browse files
authored
feat(Other): Enable ICC with Zephyr on MAX32660, MAX32662, MAX32670, MAX32672, MAX32675, MAX78000, and MAX78002 (#1570)
Signed-off-by: Ryan Wiebe <ryan.wiebe@analog.com>
1 parent af9cc2f commit d1d6fa7

7 files changed

Lines changed: 37 additions & 2 deletions

File tree

Libraries/zephyr/MAX/Source/MAX32660/max32xxx_system.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "max32660.h"
2020
#include "mxc_sys.h"
2121
#include "wdt_regs.h"
22+
#include "icc.h"
2223

2324
/*
2425
* This function is called during boot up.
@@ -39,4 +40,7 @@ void max32xx_system_init(void)
3940
MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_TMR1);
4041
MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_TMR2);
4142
MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_I2C1);
43+
44+
/* Enable instruction caching */
45+
MXC_ICC_Enable();
4246
}

Libraries/zephyr/MAX/Source/MAX32662/max32xxx_system.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
******************************************************************************/
1818

1919
#include "max32662.h"
20+
#include "icc.h"
2021

2122
/*
2223
* This function is called during boot up.
2324
*/
24-
void max32xx_system_init(void) {}
25+
void max32xx_system_init(void)
26+
{
27+
/* Enable instruction caching */
28+
MXC_ICC_Enable();
29+
}

Libraries/zephyr/MAX/Source/MAX32670/max32xxx_system.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "pwrseq_regs.h"
2121
#include "mxc_sys.h"
2222
#include "ecc_regs.h"
23+
#include "icc.h"
2324

2425
/*
2526
* This function is called during boot up.
@@ -31,4 +32,7 @@ void max32xx_system_init(void)
3132

3233
/* Make sure INRO is enabled. INRO should already be enabled during power up. */
3334
MXC_PWRSEQ->lpcn |= MXC_F_PWRSEQ_LPCN_INRO_EN;
35+
36+
/* Enable instruction caching */
37+
MXC_ICC_Enable();
3438
}

Libraries/zephyr/MAX/Source/MAX32672/max32xxx_system.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "max32672.h"
2020
#include "trimsir_regs.h"
21+
#include "icc.h"
2122

2223
/*
2324
* This function is called during boot up.
@@ -27,4 +28,7 @@ void max32xx_system_init(void)
2728
/* Disable SRAM ECC until it is handled on zephyr side */
2829
MXC_TRIMSIR->bb_sir2 &= ~(MXC_F_TRIMSIR_BB_SIR2_RAM0_1ECCEN | MXC_F_TRIMSIR_BB_SIR2_RAM2ECCEN |
2930
MXC_F_TRIMSIR_BB_SIR2_RAM3ECCEN);
31+
32+
/* Enable instruction caching */
33+
MXC_ICC_Enable();
3034
}

Libraries/zephyr/MAX/Source/MAX32675/max32xxx_system.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "max32675.h"
2020
#include "ecc_regs.h"
21+
#include "icc.h"
2122

2223
/*
2324
* This function is called during boot up.
@@ -26,4 +27,7 @@ void max32xx_system_init(void)
2627
{
2728
/* Disable SRAM ECC until it is handled on zephyr side */
2829
MXC_ECC->en &= ~MXC_F_ECC_EN_SRAM;
30+
31+
/* Enable instruction caching */
32+
MXC_ICC_Enable();
2933
}

Libraries/zephyr/MAX/Source/MAX78000/max78xxx_system.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@
2424
*/
2525
void max32xx_system_init(void)
2626
{
27+
#ifndef CONFIG_SOC_MAX78000_RV32
28+
29+
/* Enable instruction caching */
2730
MXC_ICC_Enable(MXC_ICC0);
31+
32+
#endif
2833
}

Libraries/zephyr/MAX/Source/MAX78002/max78xxx_system.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@
1717
******************************************************************************/
1818

1919
#include "max78002.h"
20+
#include "icc.h"
2021

2122
/*
2223
* This function is called during boot up.
2324
*/
24-
void max32xx_system_init(void) {}
25+
void max32xx_system_init(void)
26+
{
27+
#ifndef CONFIG_SOC_MAX78002_RV32
28+
29+
/* Enable instruction caching */
30+
MXC_ICC_Enable(MXC_ICC0);
31+
32+
#endif
33+
}

0 commit comments

Comments
 (0)