summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_x1000')
-rw-r--r--firmware/target/mips/ingenic_x1000/clk-x1000.h4
-rw-r--r--firmware/target/mips/ingenic_x1000/sfc-x1000.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_x1000/clk-x1000.h b/firmware/target/mips/ingenic_x1000/clk-x1000.h
index e19c56d0ba..f7153da564 100644
--- a/firmware/target/mips/ingenic_x1000/clk-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/clk-x1000.h
@@ -80,13 +80,13 @@ extern void clk_set_ccr_div(uint32_t divbits);
80extern void clk_set_ddr(x1000_clk_t src, uint32_t div); 80extern void clk_set_ddr(x1000_clk_t src, uint32_t div);
81 81
82/* Returns the smallest n such that infreq/n <= outfreq */ 82/* Returns the smallest n such that infreq/n <= outfreq */
83inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) 83static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq)
84{ 84{
85 return (infreq + (outfreq - 1)) / outfreq; 85 return (infreq + (outfreq - 1)) / outfreq;
86} 86}
87 87
88/* Returns the smallest n such that (infreq >> n) <= outfreq */ 88/* Returns the smallest n such that (infreq >> n) <= outfreq */
89inline uint32_t clk_calc_shift(uint32_t infreq, uint32_t outfreq) 89static inline uint32_t clk_calc_shift(uint32_t infreq, uint32_t outfreq)
90{ 90{
91 uint32_t div = clk_calc_div(infreq, outfreq); 91 uint32_t div = clk_calc_div(infreq, outfreq);
92 return __builtin_clz(div) ^ 31; 92 return __builtin_clz(div) ^ 31;
diff --git a/firmware/target/mips/ingenic_x1000/sfc-x1000.h b/firmware/target/mips/ingenic_x1000/sfc-x1000.h
index d28bcb6740..afb4aa3ce6 100644
--- a/firmware/target/mips/ingenic_x1000/sfc-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/sfc-x1000.h
@@ -87,13 +87,13 @@ extern void sfc_irq_end(void);
87extern void sfc_set_clock(uint32_t freq); 87extern void sfc_set_clock(uint32_t freq);
88 88
89/* Set the device configuration register */ 89/* Set the device configuration register */
90inline void sfc_set_dev_conf(uint32_t conf) 90static inline void sfc_set_dev_conf(uint32_t conf)
91{ 91{
92 REG_SFC_DEV_CONF = conf; 92 REG_SFC_DEV_CONF = conf;
93} 93}
94 94
95/* Control the state of the write protect pin */ 95/* Control the state of the write protect pin */
96inline void sfc_set_wp_enable(bool en) 96static inline void sfc_set_wp_enable(bool en)
97{ 97{
98 jz_writef(SFC_GLB, WP_EN(en ? 1 : 0)); 98 jz_writef(SFC_GLB, WP_EN(en ? 1 : 0));
99} 99}