stm32h7: Allow custom clock configuration to use stdclockconfig

This commit is contained in:
Anthony Merlino
2021-03-07 22:03:27 -05:00
committed by Xiang Xiao
parent 6ba23aabda
commit 40217e644f
3 changed files with 53 additions and 47 deletions
+10
View File
@@ -151,6 +151,16 @@ static inline void stm32_mco2config(uint32_t source, uint32_t div)
void stm32_clockconfig(void);
/****************************************************************************
* Name: stm32_stdclockconfig
*
* Description:
* Setup the system using the "standard" clock configuration
*
****************************************************************************/
void stm32_stdclockconfig(void);
/****************************************************************************
* Name: stm32_board_clockconfig
*
+21 -23
View File
@@ -557,6 +557,26 @@ static inline void rcc_enableapb4(void)
putreg32(regval, STM32_RCC_APB4ENR); /* Enable peripherals */
}
/****************************************************************************
* Name: rcc_enableperiphals
****************************************************************************/
static inline void rcc_enableperipherals(void)
{
rcc_enableahb1();
rcc_enableahb2();
rcc_enableahb3();
rcc_enableahb4();
rcc_enableapb1();
rcc_enableapb2();
rcc_enableapb3();
rcc_enableapb4();
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_stdclockconfig
*
@@ -567,8 +587,7 @@ static inline void rcc_enableapb4(void)
* power clocking modes!
****************************************************************************/
#ifndef CONFIG_STM32H7_CUSTOM_CLOCKCONFIG
static void stm32_stdclockconfig(void)
void stm32_stdclockconfig(void)
{
uint32_t regval;
volatile int32_t timeout;
@@ -943,24 +962,3 @@ static void stm32_stdclockconfig(void)
#endif
}
}
#endif
/****************************************************************************
* Name: rcc_enableperiphals
****************************************************************************/
static inline void rcc_enableperipherals(void)
{
rcc_enableahb1();
rcc_enableahb2();
rcc_enableahb3();
rcc_enableahb4();
rcc_enableapb1();
rcc_enableapb2();
rcc_enableapb3();
rcc_enableapb4();
}
/****************************************************************************
* Public Functions
****************************************************************************/
+22 -24
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/stm32h7/stm32h7x3xx_rcc.c
* arch/arm/src/stm32h7/stm32h7x7xx_rcc.c
*
* Copyright (C) 2018, 2019 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
@@ -559,6 +559,26 @@ static inline void rcc_enableapb4(void)
putreg32(regval, STM32_RCC_APB4ENR); /* Enable peripherals */
}
/****************************************************************************
* Name: rcc_enableperiphals
****************************************************************************/
static inline void rcc_enableperipherals(void)
{
rcc_enableahb1();
rcc_enableahb2();
rcc_enableahb3();
rcc_enableahb4();
rcc_enableapb1();
rcc_enableapb2();
rcc_enableapb3();
rcc_enableapb4();
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_stdclockconfig
*
@@ -569,8 +589,7 @@ static inline void rcc_enableapb4(void)
* power clocking modes!
****************************************************************************/
#ifndef CONFIG_STM32H7_CUSTOM_CLOCKCONFIG
static void stm32_stdclockconfig(void)
void stm32_stdclockconfig(void)
{
uint32_t regval;
volatile int32_t timeout;
@@ -933,24 +952,3 @@ static void stm32_stdclockconfig(void)
#endif
}
}
#endif
/****************************************************************************
* Name: rcc_enableperiphals
****************************************************************************/
static inline void rcc_enableperipherals(void)
{
rcc_enableahb1();
rcc_enableahb2();
rcc_enableahb3();
rcc_enableahb4();
rcc_enableapb1();
rcc_enableapb2();
rcc_enableapb3();
rcc_enableapb4();
}
/****************************************************************************
* Public Functions
****************************************************************************/