source: rtems/bsps/arm/atsam/start/pmc-config.c @ ba619b7f

Last change on this file since ba619b7f was ba619b7f, checked in by Joel Sherrill <joel@…>, on 03/01/22 at 21:38:20

bsps/arm/: Scripted embedded brains header file clean up

Updates #4625.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#include <bsp/atsam-clock-config.h>
10#include <bspopts.h>
11#include <chip.h>
12
13#if ATSAM_MCK == 123000000
14/* PLLA/HCLK/MCK clock is set to 492/246/123MHz */
15const struct atsam_clock_config atsam_clock_config = {
16  .pllar_init = (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(0x28U) |
17      CKGR_PLLAR_PLLACOUNT(0x3fU) | CKGR_PLLAR_DIVA(0x1U)),
18  .mckr_init = (PMC_MCKR_PRES_CLK_2 | PMC_MCKR_CSS_PLLA_CLK |
19      PMC_MCKR_MDIV_PCK_DIV2),
20  .mck_freq = 123*1000*1000
21};
22#elif ATSAM_MCK == 150000000
23/* PLLA/HCLK/MCK clock is set to 300/300/150MHz */
24const struct atsam_clock_config atsam_clock_config = {
25  .pllar_init = (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(0x18U) |
26      CKGR_PLLAR_PLLACOUNT(0x3fU) | CKGR_PLLAR_DIVA(0x1U)),
27  .mckr_init = (PMC_MCKR_PRES_CLK_1 | PMC_MCKR_CSS_PLLA_CLK |
28      PMC_MCKR_MDIV_PCK_DIV2),
29  .mck_freq = 150*1000*1000
30};
31#elif ATSAM_MCK == 60000000
32/* PLLA/HCLK/MCK clock is set to 60/60/60MHz */
33const struct atsam_clock_config atsam_clock_config = {
34  .pllar_init = (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(0x4U) |
35      CKGR_PLLAR_PLLACOUNT(0x3fU) | CKGR_PLLAR_DIVA(0x1U)),
36  .mckr_init = (PMC_MCKR_PRES_CLK_1 | PMC_MCKR_CSS_PLLA_CLK |
37      PMC_MCKR_MDIV_EQ_PCK),
38  .mck_freq = 60*1000*1000
39};
40#error Unknown ATSAM_MCK.
41#endif
Note: See TracBrowser for help on using the repository browser.