no-OS
Macros | Functions
clk_altera_a10_fpll.c File Reference

Driver for the Altera FPLL. More...

#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <inttypes.h>
#include <limits.h>
#include "io.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "no_os_alloc.h"
#include "clk_altera_a10_fpll.h"
Include dependency graph for clk_altera_a10_fpll.c:

Macros

#define FPLL_REG_C_COUNTER0   0x10D
 
#define FPLL_REG_C_COUNTER1   0x10E
 
#define FPLL_REG_C_COUNTER2   0x10F
 
#define FPLL_REG_C_COUNTER3   0x110
 
#define FPLL_REG_C_COUNTER4   0x111
 
#define FPLL_REG_DIV_COUNTER0   0x12B
 
#define FPLL_REG_DIV_COUNTER1   0x12C
 
#define A10_FPLL_PFD_MIN   25000 /* 25.000 MHz */
 
#define A10_FPLL_PFD_MAX   60000 /* 60.000 MHz */
 
#define A10_FPLL_VCO_MIN   4800000 /* 4.800 GHz */
 
#define A10_FPLL_VCO_MAX   14025000 /* 14.025 GHz */
 

Functions

uint32_t altera_a10_fpll_read (struct altera_a10_fpll *fpll, uint32_t addr)
 altera_a10_fpll_read More...
 
void altera_a10_fpll_write (struct altera_a10_fpll *fpll, uint32_t addr, uint32_t val)
 altera_a10_fpll_write More...
 
void altera_a10_fpll_update (struct altera_a10_fpll *fpll, uint32_t addr, uint32_t mask, uint32_t val)
 altera_a10_fpll_update More...
 
uint32_t altera_a10_acquire_arbitration (struct altera_a10_fpll *fpll)
 altera_a10_acquire_arbitration More...
 
void altera_a10_release_arbitration (struct altera_a10_fpll *fpll, bool run_calibration)
 altera_a10_release_arbitration More...
 
uint32_t altera_a10_fpll_lookup_lf_resistance (uint32_t fvco, uint32_t m)
 altera_a10_fpll_lookup_lf_resistance More...
 
int32_t altera_a10_fpll_lookup_cp_current (uint32_t fvco, uint32_t m)
 altera_a10_fpll_lookup_cp_current More...
 
int32_t altera_a10_fpll_calc_params (uint32_t fref, uint32_t fout, uint32_t *best_n, uint32_t *best_m, uint32_t *best_c0, uint32_t *best_fvco)
 altera_a10_fpll_calc_params More...
 
int32_t altera_a10_fpll_round_rate (struct altera_a10_fpll *fpll, uint32_t rate)
 altera_a10_fpll_round_rate More...
 
int32_t altera_a10_fpll_pll_calibration_check (struct altera_a10_fpll *fpll)
 altera_a10_fpll_pll_calibration_check More...
 
int32_t altera_a10_fpll_set_rate (struct altera_a10_fpll *fpll, uint32_t rate)
 altera_a10_fpll_set_rate More...
 
uint32_t altera_a10_fpll_recalc_rate (struct altera_a10_fpll *fpll)
 altera_a10_fpll_recalc_rate More...
 
int32_t altera_a10_fpll_is_enabled (struct altera_a10_fpll *fpll)
 altera_a10_fpll_is_enabled More...
 
int32_t altera_a10_fpll_enable (struct altera_a10_fpll *fpll)
 altera_a10_fpll_enable More...
 
void altera_a10_fpll_disable (struct altera_a10_fpll *fpll)
 altera_a10_fpll_disable More...
 
int32_t altera_a10_fpll_init (struct altera_a10_fpll **a10_fpll, const struct altera_a10_fpll_init *init)
 altera_a10_fpll_init More...
 
int32_t altera_a10_fpll_remove (struct altera_a10_fpll *fpll)
 altera_a10_fpll_remove More...
 

Detailed Description

Driver for the Altera FPLL.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2018(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ A10_FPLL_PFD_MAX

#define A10_FPLL_PFD_MAX   60000 /* 60.000 MHz */

◆ A10_FPLL_PFD_MIN

#define A10_FPLL_PFD_MIN   25000 /* 25.000 MHz */

◆ A10_FPLL_VCO_MAX

#define A10_FPLL_VCO_MAX   14025000 /* 14.025 GHz */

◆ A10_FPLL_VCO_MIN

#define A10_FPLL_VCO_MIN   4800000 /* 4.800 GHz */

◆ FPLL_REG_C_COUNTER0

#define FPLL_REG_C_COUNTER0   0x10D

◆ FPLL_REG_C_COUNTER1

#define FPLL_REG_C_COUNTER1   0x10E

◆ FPLL_REG_C_COUNTER2

#define FPLL_REG_C_COUNTER2   0x10F

◆ FPLL_REG_C_COUNTER3

#define FPLL_REG_C_COUNTER3   0x110

◆ FPLL_REG_C_COUNTER4

#define FPLL_REG_C_COUNTER4   0x111

◆ FPLL_REG_DIV_COUNTER0

#define FPLL_REG_DIV_COUNTER0   0x12B

◆ FPLL_REG_DIV_COUNTER1

#define FPLL_REG_DIV_COUNTER1   0x12C

Function Documentation

◆ altera_a10_acquire_arbitration()

uint32_t altera_a10_acquire_arbitration ( struct altera_a10_fpll fpll)

altera_a10_acquire_arbitration

Here is the caller graph for this function:

◆ altera_a10_fpll_calc_params()

int32_t altera_a10_fpll_calc_params ( uint32_t  fref,
uint32_t  fout,
uint32_t *  best_n,
uint32_t *  best_m,
uint32_t *  best_c0,
uint32_t *  best_fvco 
)

altera_a10_fpll_calc_params

Here is the caller graph for this function:

◆ altera_a10_fpll_disable()

void altera_a10_fpll_disable ( struct altera_a10_fpll fpll)

altera_a10_fpll_disable

Here is the caller graph for this function:

◆ altera_a10_fpll_enable()

int32_t altera_a10_fpll_enable ( struct altera_a10_fpll fpll)

altera_a10_fpll_enable

Here is the caller graph for this function:

◆ altera_a10_fpll_init()

int32_t altera_a10_fpll_init ( struct altera_a10_fpll **  a10_fpll,
const struct altera_a10_fpll_init init 
)

altera_a10_fpll_init

Here is the caller graph for this function:

◆ altera_a10_fpll_is_enabled()

int32_t altera_a10_fpll_is_enabled ( struct altera_a10_fpll fpll)

altera_a10_fpll_is_enabled

◆ altera_a10_fpll_lookup_cp_current()

int32_t altera_a10_fpll_lookup_cp_current ( uint32_t  fvco,
uint32_t  m 
)

altera_a10_fpll_lookup_cp_current

Here is the caller graph for this function:

◆ altera_a10_fpll_lookup_lf_resistance()

uint32_t altera_a10_fpll_lookup_lf_resistance ( uint32_t  fvco,
uint32_t  m 
)

altera_a10_fpll_lookup_lf_resistance

Here is the caller graph for this function:

◆ altera_a10_fpll_pll_calibration_check()

int32_t altera_a10_fpll_pll_calibration_check ( struct altera_a10_fpll fpll)

altera_a10_fpll_pll_calibration_check

Here is the caller graph for this function:

◆ altera_a10_fpll_read()

uint32_t altera_a10_fpll_read ( struct altera_a10_fpll fpll,
uint32_t  addr 
)

altera_a10_fpll_read

Here is the caller graph for this function:

◆ altera_a10_fpll_recalc_rate()

uint32_t altera_a10_fpll_recalc_rate ( struct altera_a10_fpll fpll)

altera_a10_fpll_recalc_rate

◆ altera_a10_fpll_remove()

int32_t altera_a10_fpll_remove ( struct altera_a10_fpll fpll)

altera_a10_fpll_remove

Here is the caller graph for this function:

◆ altera_a10_fpll_round_rate()

int32_t altera_a10_fpll_round_rate ( struct altera_a10_fpll fpll,
uint32_t  rate 
)

altera_a10_fpll_round_rate

◆ altera_a10_fpll_set_rate()

int32_t altera_a10_fpll_set_rate ( struct altera_a10_fpll fpll,
uint32_t  rate 
)

altera_a10_fpll_set_rate

Here is the caller graph for this function:

◆ altera_a10_fpll_update()

void altera_a10_fpll_update ( struct altera_a10_fpll fpll,
uint32_t  addr,
uint32_t  mask,
uint32_t  val 
)

altera_a10_fpll_update

Here is the caller graph for this function:

◆ altera_a10_fpll_write()

void altera_a10_fpll_write ( struct altera_a10_fpll fpll,
uint32_t  addr,
uint32_t  val 
)

altera_a10_fpll_write

Here is the caller graph for this function:

◆ altera_a10_release_arbitration()

void altera_a10_release_arbitration ( struct altera_a10_fpll fpll,
bool  run_calibration 
)

altera_a10_release_arbitration

Here is the caller graph for this function: