37 #ifndef CHIP_PLL_H_INCLUDED 38 #define CHIP_PLL_H_INCLUDED 55 #define PLL_OUTPUT_MIN_HZ 160000000 56 #define PLL_OUTPUT_MAX_HZ 500000000 58 #define PLL_INPUT_MIN_HZ 3000000 59 #define PLL_INPUT_MAX_HZ 32000000 65 #define PLL_UPLL_HZ 480000000 67 #define PLL_COUNT 0x3fU 82 #define pll_get_default_rate(pll_id) \ 83 ((osc_get_rate(CONFIG_PLL##pll_id##_SOURCE) \ 84 * CONFIG_PLL##pll_id##_MUL) \ 85 / CONFIG_PLL##pll_id##_DIV) 88 #ifdef CONFIG_PLL1_SOURCE 89 # undef CONFIG_PLL1_SOURCE 91 #ifdef CONFIG_PLL1_MUL 92 # undef CONFIG_PLL1_MUL 94 #ifdef CONFIG_PLL1_DIV 95 # undef CONFIG_PLL1_DIV 97 #define CONFIG_PLL1_SOURCE PLL_SRC_MAINCK_XTAL 98 #define CONFIG_PLL1_MUL 0 99 #define CONFIG_PLL1_DIV 0 107 enum pll_source e_src, uint32_t ul_div, uint32_t ul_mul)
113 if (ul_div == 0 && ul_mul == 0) {
131 #define pll_config_defaults(cfg, pll_id) \ 132 pll_config_init(cfg, \ 133 CONFIG_PLL##pll_id##_SOURCE, \ 134 CONFIG_PLL##pll_id##_DIV, \ 135 CONFIG_PLL##pll_id##_MUL) 193 return pmc_is_locked_upll();
223 #ifdef CONFIG_PLL0_SOURCE 232 #ifdef CONFIG_PLL1_SOURCE static void osc_wait_ready(uint8_t id)
Wait until the oscillator identified by id is ready.
#define PMC
(PMC ) Base Address
#define CONFIG_PLL1_SOURCE
static void pll_config_write(const struct pll_config *p_cfg, uint32_t ul_pll_id)
static uint32_t osc_get_rate(uint32_t ul_id)
#define PLL_OUTPUT_MIN_HZ
#define CKGR_UCKR_UPLLCOUNT(value)
#define PLL_OUTPUT_MAX_HZ
#define CKGR_PLLAR_MULA(value)
Internal 8MHz RC oscillator.
#define OSC_MAINCK_12M_RC
Internal 12MHz RC oscillator.
#define CKGR_UCKR_UPLLEN
(CKGR_UCKR) UTMI PLL Enable
static void pll_disable(uint32_t ul_pll_id)
Internal 12MHz RC oscillator.
pll_source
PLL clock source.
static void pll_enable_source(enum pll_source e_src)
Enable the source of the pll. The source is enabled, if the source is not already running...
External bypass oscillator.
uint32_t pmc_is_locked_pllack(void)
Is PLLA locked?
static void pll_enable(const struct pll_config *p_cfg, uint32_t ul_pll_id)
static void osc_enable(uint32_t ul_id)
#define CKGR_PLLAR_ONE
(CKGR_PLLAR) Must Be Set to 1
#define CKGR_PLLAR_DIVA(value)
#define CONFIG_PLL0_SOURCE
Hardware-specific representation of PLL configuration.
#define OSC_MAINCK_BYPASS
External bypass oscillator.
Internal 4MHz RC oscillator.
#define CKGR_PLLAR_PLLACOUNT(value)
External crystal oscillator.
static void pll_config_read(struct pll_config *p_cfg, uint32_t ul_pll_id)
static void pll_enable_config_defaults(unsigned int ul_pll_id)
Enable the pll with the default configuration. PLL is enabled, if the PLL is not already locked...
#define OSC_MAINCK_8M_RC
Internal 8MHz RC oscillator.
#define OSC_MAINCK_4M_RC
Internal 4MHz RC oscillator.
#define OSC_MAINCK_XTAL
External crystal oscillator.
static void pll_config_init(struct pll_config *p_cfg, enum pll_source e_src, uint32_t ul_div, uint32_t ul_mul)
Chip-specific oscillator management functions.
#define Assert(expr)
This macro is used to test fatal errors.
#define NR_PLLS
Number of on-chip PLLs.
static uint32_t pll_is_locked(uint32_t ul_pll_id)
void pmc_disable_pllack(void)
Disable PLLA clock.