Skip to content
Permalink
Browse files

soc: msp432p4xx: Get CPU clock frequency from DTS

The SoC initialization code used system clock frequency
as a CPU clock frequency. This commit corrects that by
obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
  • Loading branch information...
pizi-nordic authored and carlescufi committed Apr 11, 2019
1 parent f2d84f0 commit a8b787f4e7b8adc9d94300a4cc02ea8203ee9a0b
@@ -44,6 +44,7 @@

#include <stdint.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <generated_dts_board.h>

/*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
@@ -68,7 +69,7 @@
// <12000000> 12 MHz
// <24000000> 24 MHz
// <48000000> 48 MHz
#define __SYSTEM_CLOCK CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define __SYSTEM_CLOCK DT_ARM_CORTEX_M4F_0_CLOCK_FREQUENCY

/*--------------------- Power Regulator Configuration -----------------------*/
// Power Regulator Mode
@@ -44,6 +44,7 @@

#include <stdint.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <generated_dts_board.h>

/*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
@@ -68,7 +69,7 @@
// <12000000> 12 MHz
// <24000000> 24 MHz
// <48000000> 48 MHz
#define __SYSTEM_CLOCK CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define __SYSTEM_CLOCK DT_ARM_CORTEX_M4F_0_CLOCK_FREQUENCY

/*--------------------- Power Regulator Configuration -----------------------*/
// Power Regulator Mode
@@ -44,6 +44,7 @@

#include <stdint.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <generated_dts_board.h>

/*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
@@ -68,7 +69,7 @@
// <12000000> 12 MHz
// <24000000> 24 MHz
// <48000000> 48 MHz
#define __SYSTEM_CLOCK CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define __SYSTEM_CLOCK DT_ARM_CORTEX_M4F_0_CLOCK_FREQUENCY

/*--------------------- Power Regulator Configuration -----------------------*/
// Power Regulator Mode
@@ -44,6 +44,7 @@

#include <stdint.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <generated_dts_board.h>

/*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
@@ -68,7 +69,7 @@
// <12000000> 12 MHz
// <24000000> 24 MHz
// <48000000> 48 MHz
#define __SYSTEM_CLOCK CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define __SYSTEM_CLOCK DT_ARM_CORTEX_M4F_0_CLOCK_FREQUENCY

/*--------------------- Power Regulator Configuration -----------------------*/
// Power Regulator Mode
@@ -44,6 +44,7 @@

#include <stdint.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <generated_dts_board.h>

/*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
@@ -68,7 +69,7 @@
// <12000000> 12 MHz
// <24000000> 24 MHz
// <48000000> 48 MHz
#define __SYSTEM_CLOCK CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define __SYSTEM_CLOCK DT_ARM_CORTEX_M4F_0_CLOCK_FREQUENCY

/*--------------------- Power Regulator Configuration -----------------------*/
// Power Regulator Mode

0 comments on commit a8b787f

Please sign in to comment.
You can’t perform that action at this time.