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>
This commit is contained in:
parent
f2d84f08ff
commit
a8b787f4e7
5 changed files with 10 additions and 5 deletions
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue