summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/clk-x1000.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/clk-x1000.h')
-rw-r--r--firmware/target/mips/ingenic_x1000/clk-x1000.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/target/mips/ingenic_x1000/clk-x1000.h b/firmware/target/mips/ingenic_x1000/clk-x1000.h
index f7153da564..4b1d4ef838 100644
--- a/firmware/target/mips/ingenic_x1000/clk-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/clk-x1000.h
@@ -22,8 +22,9 @@
22#ifndef __CLK_X1000_H__ 22#ifndef __CLK_X1000_H__
23#define __CLK_X1000_H__ 23#define __CLK_X1000_H__
24 24
25#include <stdint.h> 25#include "config.h"
26#include "x1000/cpm.h" 26#include "x1000/cpm.h"
27#include <stdint.h>
27 28
28/* Used as arguments to clk_set_ccr_mux() */ 29/* Used as arguments to clk_set_ccr_mux() */
29#define CLKMUX_SCLK_A(x) jz_orf(CPM_CCR, SEL_SRC_V(x)) 30#define CLKMUX_SCLK_A(x) jz_orf(CPM_CCR, SEL_SRC_V(x))
@@ -67,17 +68,17 @@ extern uint32_t clk_get(x1000_clk_t clk);
67extern const char* clk_get_name(x1000_clk_t clk); 68extern const char* clk_get_name(x1000_clk_t clk);
68 69
69/* Clock initialization */ 70/* Clock initialization */
70extern void clk_init_early(void); 71extern void clk_init_early(void) INIT_ATTR;
71extern void clk_init(void); 72extern void clk_init(void) INIT_ATTR;
72 73
73/* Sets system clock multiplexers */ 74/* Sets system clock multiplexers */
74extern void clk_set_ccr_mux(uint32_t muxbits); 75extern void clk_set_ccr_mux(uint32_t muxbits) INIT_ATTR;
75 76
76/* Sets system clock dividers */ 77/* Sets system clock dividers */
77extern void clk_set_ccr_div(uint32_t divbits); 78extern void clk_set_ccr_div(uint32_t divbits) INIT_ATTR;
78 79
79/* Sets DDR clock source and divider */ 80/* Sets DDR clock source and divider */
80extern void clk_set_ddr(x1000_clk_t src, uint32_t div); 81extern void clk_set_ddr(x1000_clk_t src, uint32_t div) INIT_ATTR;
81 82
82/* Returns the smallest n such that infreq/n <= outfreq */ 83/* Returns the smallest n such that infreq/n <= outfreq */
83static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) 84static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq)