no-OS
clk_altera_a10_fpll.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef CLK_ALTERA_A10_FPLL_H_
40 #define CLK_ALTERA_A10_FPLL_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdbool.h>
46 
47 /******************************************************************************/
48 /*************************** Types Declarations *******************************/
49 /******************************************************************************/
51  const char *name;
52  uint32_t base;
53  uint32_t parent_rate;
55 };
56 
58  const char *name;
59  uint32_t base;
60  uint32_t parent_rate;
61 };
62 
63 /******************************************************************************/
64 /************************ Functions Declarations ******************************/
65 /******************************************************************************/
66 int32_t altera_a10_fpll_init(struct altera_a10_fpll **a10_fpll,
67  const struct altera_a10_fpll_init *init);
68 int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll);
69 int32_t altera_a10_fpll_set_rate(struct altera_a10_fpll *fpll, uint32_t rate);
70 int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll);
71 void altera_a10_fpll_disable(struct altera_a10_fpll *fpll);
72 #endif
timeout
uint32_t timeout
Definition: ad413x.c:54
altera_a10_release_arbitration
void altera_a10_release_arbitration(struct altera_a10_fpll *fpll, bool run_calibration)
altera_a10_release_arbitration
Definition: clk_altera_a10_fpll.c:132
altera_a10_fpll_enable
int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll)
altera_a10_fpll_enable
Definition: clk_altera_a10_fpll.c:453
no_os_min_t
#define no_os_min_t(type, x, y)
Definition: no_os_util.h:65
altera_a10_fpll_write
void altera_a10_fpll_write(struct altera_a10_fpll *fpll, uint32_t addr, uint32_t val)
altera_a10_fpll_write
Definition: clk_altera_a10_fpll.c:87
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
Definition: clk_altera_a10_fpll.c:345
altera_a10_fpll_enable
int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll)
altera_a10_fpll_enable
Definition: clk_altera_a10_fpll.c:453
altera_a10_acquire_arbitration
uint32_t altera_a10_acquire_arbitration(struct altera_a10_fpll *fpll)
altera_a10_acquire_arbitration
Definition: clk_altera_a10_fpll.c:110
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
Definition: clk_altera_a10_fpll.c:243
FPLL_REG_DIV_COUNTER0
#define FPLL_REG_DIV_COUNTER0
Definition: clk_altera_a10_fpll.c:63
altera_a10_fpll_remove
int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll)
altera_a10_fpll_remove
Definition: clk_altera_a10_fpll.c:492
FPLL_REG_C_COUNTER2
#define FPLL_REG_C_COUNTER2
Definition: clk_altera_a10_fpll.c:59
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:60
FPLL_REG_DIV_COUNTER1
#define FPLL_REG_DIV_COUNTER1
Definition: clk_altera_a10_fpll.c:64
altera_a10_fpll::parent_rate
uint32_t parent_rate
Definition: clk_altera_a10_fpll.h:53
altera_a10_fpll_init::name
const char * name
Definition: clk_altera_a10_fpll.h:58
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
Definition: clk_altera_a10_fpll.c:319
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
Definition: clk_altera_a10_fpll.c:345
A10_FPLL_PFD_MIN
#define A10_FPLL_PFD_MIN
Definition: clk_altera_a10_fpll.c:66
altera_a10_fpll_remove
int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll)
altera_a10_fpll_remove
Definition: clk_altera_a10_fpll.c:492
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
Definition: clk_altera_a10_fpll.c:181
altera_a10_fpll_read
uint32_t altera_a10_fpll_read(struct altera_a10_fpll *fpll, uint32_t addr)
altera_a10_fpll_read
Definition: clk_altera_a10_fpll.c:78
no_os_error.h
Error codes definition.
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:56
FPLL_REG_C_COUNTER3
#define FPLL_REG_C_COUNTER3
Definition: clk_altera_a10_fpll.c:60
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
Definition: clk_altera_a10_fpll.c:141
A10_FPLL_VCO_MAX
#define A10_FPLL_VCO_MAX
Definition: clk_altera_a10_fpll.c:69
altera_a10_fpll_init::parent_rate
uint32_t parent_rate
Definition: clk_altera_a10_fpll.h:60
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
Definition: clk_altera_a10_fpll.c:298
clk_altera_a10_fpll.h
Driver for the Altera FPLL.
altera_a10_fpll::name
const char * name
Definition: clk_altera_a10_fpll.h:51
A10_FPLL_VCO_MIN
#define A10_FPLL_VCO_MIN
Definition: clk_altera_a10_fpll.c:68
no_os_clamp_t
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:75
altera_a10_fpll_disable
void altera_a10_fpll_disable(struct altera_a10_fpll *fpll)
altera_a10_fpll_disable
Definition: clk_altera_a10_fpll.c:463
no_os_max_t
#define no_os_max_t(type, x, y)
Definition: no_os_util.h:70
altera_a10_fpll_init
Definition: clk_altera_a10_fpll.h:57
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
A10_FPLL_PFD_MAX
#define A10_FPLL_PFD_MAX
Definition: clk_altera_a10_fpll.c:67
altera_a10_fpll_recalc_rate
uint32_t altera_a10_fpll_recalc_rate(struct altera_a10_fpll *fpll)
altera_a10_fpll_recalc_rate
Definition: clk_altera_a10_fpll.c:402
altera_a10_fpll::initial_recalc
bool initial_recalc
Definition: clk_altera_a10_fpll.h:54
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
Definition: clk_altera_a10_fpll.c:471
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
altera_a10_fpll
Definition: clk_altera_a10_fpll.h:50
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
Definition: clk_altera_a10_fpll.c:471
no_os_round_up
#define no_os_round_up(x, y)
Definition: no_os_util.h:81
altera_a10_fpll_disable
void altera_a10_fpll_disable(struct altera_a10_fpll *fpll)
altera_a10_fpll_disable
Definition: clk_altera_a10_fpll.c:463
no_os_util.h
Header file of utility functions.
altera_a10_fpll::base
uint32_t base
Definition: clk_altera_a10_fpll.h:52
altera_a10_fpll_init::base
uint32_t base
Definition: clk_altera_a10_fpll.h:59
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
Definition: clk_altera_a10_fpll.c:96
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
altera_a10_fpll_is_enabled
int32_t altera_a10_fpll_is_enabled(struct altera_a10_fpll *fpll)
altera_a10_fpll_is_enabled
Definition: clk_altera_a10_fpll.c:445
FPLL_REG_C_COUNTER4
#define FPLL_REG_C_COUNTER4
Definition: clk_altera_a10_fpll.c:61