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"
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 | |
void | altera_a10_fpll_write (struct altera_a10_fpll *fpll, uint32_t addr, uint32_t val) |
altera_a10_fpll_write | |
void | altera_a10_fpll_update (struct altera_a10_fpll *fpll, uint32_t addr, uint32_t mask, uint32_t val) |
altera_a10_fpll_update | |
uint32_t | altera_a10_acquire_arbitration (struct altera_a10_fpll *fpll) |
altera_a10_acquire_arbitration | |
void | altera_a10_release_arbitration (struct altera_a10_fpll *fpll, bool run_calibration) |
altera_a10_release_arbitration | |
uint32_t | altera_a10_fpll_lookup_lf_resistance (uint32_t fvco, uint32_t m) |
altera_a10_fpll_lookup_lf_resistance | |
int32_t | altera_a10_fpll_lookup_cp_current (uint32_t fvco, uint32_t m) |
altera_a10_fpll_lookup_cp_current | |
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 | |
int32_t | altera_a10_fpll_round_rate (struct altera_a10_fpll *fpll, uint32_t rate) |
altera_a10_fpll_round_rate | |
int32_t | altera_a10_fpll_pll_calibration_check (struct altera_a10_fpll *fpll) |
altera_a10_fpll_pll_calibration_check | |
int32_t | altera_a10_fpll_set_rate (struct altera_a10_fpll *fpll, uint32_t rate) |
altera_a10_fpll_set_rate | |
uint32_t | altera_a10_fpll_recalc_rate (struct altera_a10_fpll *fpll) |
altera_a10_fpll_recalc_rate | |
int32_t | altera_a10_fpll_is_enabled (struct altera_a10_fpll *fpll) |
altera_a10_fpll_is_enabled | |
int32_t | altera_a10_fpll_enable (struct altera_a10_fpll *fpll) |
altera_a10_fpll_enable | |
void | altera_a10_fpll_disable (struct altera_a10_fpll *fpll) |
altera_a10_fpll_disable | |
int32_t | altera_a10_fpll_init (struct altera_a10_fpll **a10_fpll, const struct altera_a10_fpll_init *init) |
altera_a10_fpll_init | |
int32_t | altera_a10_fpll_remove (struct altera_a10_fpll *fpll) |
altera_a10_fpll_remove | |
Driver for the Altera FPLL.
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:
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.
#define A10_FPLL_PFD_MAX 60000 /* 60.000 MHz */ |
#define A10_FPLL_PFD_MIN 25000 /* 25.000 MHz */ |
#define A10_FPLL_VCO_MAX 14025000 /* 14.025 GHz */ |
#define A10_FPLL_VCO_MIN 4800000 /* 4.800 GHz */ |
#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 |
uint32_t altera_a10_acquire_arbitration | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_acquire_arbitration
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
void altera_a10_fpll_disable | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_disable
int32_t altera_a10_fpll_enable | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_enable
int32_t altera_a10_fpll_init | ( | struct altera_a10_fpll ** | a10_fpll, |
const struct altera_a10_fpll_init * | init ) |
int32_t altera_a10_fpll_is_enabled | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_is_enabled
int32_t altera_a10_fpll_lookup_cp_current | ( | uint32_t | fvco, |
uint32_t | m ) |
altera_a10_fpll_lookup_cp_current
uint32_t altera_a10_fpll_lookup_lf_resistance | ( | uint32_t | fvco, |
uint32_t | m ) |
altera_a10_fpll_lookup_lf_resistance
int32_t altera_a10_fpll_pll_calibration_check | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_pll_calibration_check
uint32_t altera_a10_fpll_read | ( | struct altera_a10_fpll * | fpll, |
uint32_t | addr ) |
altera_a10_fpll_read
uint32_t altera_a10_fpll_recalc_rate | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_recalc_rate
int32_t altera_a10_fpll_remove | ( | struct altera_a10_fpll * | fpll | ) |
altera_a10_fpll_remove
int32_t altera_a10_fpll_round_rate | ( | struct altera_a10_fpll * | fpll, |
uint32_t | rate ) |
altera_a10_fpll_round_rate
int32_t altera_a10_fpll_set_rate | ( | struct altera_a10_fpll * | fpll, |
uint32_t | rate ) |
altera_a10_fpll_set_rate
void altera_a10_fpll_update | ( | struct altera_a10_fpll * | fpll, |
uint32_t | addr, | ||
uint32_t | mask, | ||
uint32_t | val ) |
altera_a10_fpll_update
void altera_a10_fpll_write | ( | struct altera_a10_fpll * | fpll, |
uint32_t | addr, | ||
uint32_t | val ) |
altera_a10_fpll_write
void altera_a10_release_arbitration | ( | struct altera_a10_fpll * | fpll, |
bool | run_calibration ) |
altera_a10_release_arbitration