Skip to content

Commit

Permalink
soc: msp432p4xx: Get CPU clock frequency from DTS
Browse files Browse the repository at this point in the history
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 Jul 24, 2019
1 parent f2d84f0 commit a8b787f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Expand Up @@ -44,6 +44,7 @@


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


/*--------------------- Configuration Instructions ---------------------------- /*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1: 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
Expand All @@ -68,7 +69,7 @@
// <12000000> 12 MHz // <12000000> 12 MHz
// <24000000> 24 MHz // <24000000> 24 MHz
// <48000000> 48 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 Configuration -----------------------*/
// Power Regulator Mode // Power Regulator Mode
Expand Down
Expand Up @@ -44,6 +44,7 @@


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


/*--------------------- Configuration Instructions ---------------------------- /*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1: 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
Expand All @@ -68,7 +69,7 @@
// <12000000> 12 MHz // <12000000> 12 MHz
// <24000000> 24 MHz // <24000000> 24 MHz
// <48000000> 48 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 Configuration -----------------------*/
// Power Regulator Mode // Power Regulator Mode
Expand Down
Expand Up @@ -44,6 +44,7 @@


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


/*--------------------- Configuration Instructions ---------------------------- /*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1: 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
Expand All @@ -68,7 +69,7 @@
// <12000000> 12 MHz // <12000000> 12 MHz
// <24000000> 24 MHz // <24000000> 24 MHz
// <48000000> 48 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 Configuration -----------------------*/
// Power Regulator Mode // Power Regulator Mode
Expand Down
Expand Up @@ -44,6 +44,7 @@


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


/*--------------------- Configuration Instructions ---------------------------- /*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1: 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
Expand All @@ -68,7 +69,7 @@
// <12000000> 12 MHz // <12000000> 12 MHz
// <24000000> 24 MHz // <24000000> 24 MHz
// <48000000> 48 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 Configuration -----------------------*/
// Power Regulator Mode // Power Regulator Mode
Expand Down
Expand Up @@ -44,6 +44,7 @@


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


/*--------------------- Configuration Instructions ---------------------------- /*--------------------- Configuration Instructions ----------------------------
1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1: 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
Expand All @@ -68,7 +69,7 @@
// <12000000> 12 MHz // <12000000> 12 MHz
// <24000000> 24 MHz // <24000000> 24 MHz
// <48000000> 48 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 Configuration -----------------------*/
// Power Regulator Mode // Power Regulator Mode
Expand Down

0 comments on commit a8b787f

Please sign in to comment.