summaryrefslogtreecommitdiff
path: root/nuttx/configs/olimex-stm32-p107/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-22 15:12:50 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-22 15:12:50 +0000
commit273a2b0d87cc6bde28cbae477afc313f017b4d3a (patch)
tree1a9237dab9454102679fad0b6b1570ee271f4986 /nuttx/configs/olimex-stm32-p107/src
parentb3da63f487b2ccc69afd9610e0a6082d8482df56 (diff)
downloadpx4-nuttx-273a2b0d87cc6bde28cbae477afc313f017b4d3a.tar.gz
px4-nuttx-273a2b0d87cc6bde28cbae477afc313f017b4d3a.tar.bz2
px4-nuttx-273a2b0d87cc6bde28cbae477afc313f017b4d3a.zip
Make the Olimex stm32 p107 clock configuratin the standard for connectivity line devices
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5175 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-stm32-p107/src')
-rw-r--r--nuttx/configs/olimex-stm32-p107/src/up_boot.c108
1 files changed, 0 insertions, 108 deletions
diff --git a/nuttx/configs/olimex-stm32-p107/src/up_boot.c b/nuttx/configs/olimex-stm32-p107/src/up_boot.c
index d8cba509e..d7ece5a1e 100644
--- a/nuttx/configs/olimex-stm32-p107/src/up_boot.c
+++ b/nuttx/configs/olimex-stm32-p107/src/up_boot.c
@@ -71,111 +71,3 @@
void stm32_boardinitialize(void)
{
}
-
-/************************************************************************************
- * Name: stm32_board_clockconfig
- *
- * Description:
- * Any STM32 board may replace the "standard" board clock configuration logic with
- * its own, custom clock cofiguration logic.
- *
- ************************************************************************************/
-
-#ifdef CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG
-void stm32_board_clockconfig(void)
-{
- uint32_t regval;
-
- regval = getreg32(STM32_RCC_CR);
- regval &= ~RCC_CR_HSEBYP; /* Disable HSE clock bypass */
- regval |= RCC_CR_HSEON; /* Enable HSE */
- putreg32(regval, STM32_RCC_CR);
-
- /* Set flash wait states
- * Sysclk runs with 72MHz -> 2 waitstates.
- * 0WS from 0-24MHz
- * 1WS from 24-48MHz
- * 2WS from 48-72MHz
- */
-
- regval = getreg32(STM32_FLASH_ACR);
- regval &= ~FLASH_ACR_LATENCY_MASK;
- regval |= (FLASH_ACR_LATENCY_2|FLASH_ACR_PRTFBE);
- putreg32(regval, STM32_FLASH_ACR);
-
- regval = getreg32(STM32_RCC_CFGR2);
- regval &= ~(RCC_CFGR2_PREDIV2_MASK
- | RCC_CFGR2_PLL2MUL_MASK
- | RCC_CFGR2_PREDIV1SRC_MASK
- | RCC_CFGR2_PREDIV1_MASK);
- regval |= RCC_CFGR2_PREDIV2d5; /* 25MHz / 5 */
- regval |= RCC_CFGR2_PLL2MULx8; /* 5MHz * 8 => 40MHz */
- regval |= RCC_CFGR2_PREDIV1SRC_PLL2; /* Use PLL2 as input for PREDIV1 */
- regval |= RCC_CFGR2_PREDIV1d5; /* 40MHz / 5 => 8MHz */
- putreg32(regval, STM32_RCC_CFGR2);
-
- /* Set the PCLK2 divider */
-
- regval = getreg32(STM32_RCC_CFGR);
- regval &= ~(RCC_CFGR_PPRE2_MASK | RCC_CFGR_HPRE_MASK);
- regval |= STM32_RCC_CFGR_PPRE2;
- regval |= RCC_CFGR_HPRE_SYSCLK;
- putreg32(regval, STM32_RCC_CFGR);
-
- /* Set the PCLK1 divider */
-
- regval = getreg32(STM32_RCC_CFGR);
- regval &= ~RCC_CFGR_PPRE1_MASK;
- regval |= STM32_RCC_CFGR_PPRE1;
- putreg32(regval, STM32_RCC_CFGR);
-
- regval = getreg32(STM32_RCC_CR);
- regval |= RCC_CR_PLL2ON;
- putreg32(regval, STM32_RCC_CR);
-
- /* Wait for PLL2 ready */
-
- while((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0);
-
- /* Setup PLL3 for RMII clock on MCO */
-
- regval = getreg32(STM32_RCC_CFGR2);
- regval &= ~(RCC_CFGR2_PLL3MUL_MASK);
- regval |= RCC_CFGR2_PLL3MULx10;
- putreg32(regval, STM32_RCC_CFGR2);
-
- /* Switch PLL3 on */
-
- regval = getreg32(STM32_RCC_CR);
- regval |= RCC_CR_PLL3ON;
- putreg32(regval, STM32_RCC_CR);
-
- while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL3RDY) == 0);
-
- /* Set main PLL source 8MHz * 9 => 72MHz*/
-
- regval = getreg32(STM32_RCC_CFGR);
- regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLMUL_MASK);
- regval |= (RCC_CFGR_PLLSRC | RCC_CFGR_PLLMUL_CLKx9);
- putreg32(regval, STM32_RCC_CFGR);
-
- /* Switch main PLL on */
-
- regval = getreg32(STM32_RCC_CR);
- regval |= RCC_CR_PLLON;
- putreg32(regval, STM32_RCC_CR);
-
- while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0);
-
- /* Select PLL as system clock source */
-
- regval = getreg32(STM32_RCC_CFGR);
- regval &= ~RCC_CFGR_SW_MASK;
- regval |= RCC_CFGR_SW_PLL;
- putreg32(regval, STM32_RCC_CFGR);
-
- /* Wait until PLL is used as the system clock source */
-
- while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_PLL) == 0);
-}
-#endif