diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-03 16:17:43 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-31 08:10:41 -0500 |
commit | 484a79fcc0bb762acc1c3a502b237a68588ab4ab (patch) | |
tree | b27aac3480ee800bd9690c7637c53af03310961a /firmware/target/mips/ingenic_x1000/clk-x1000.h | |
parent | a980d5f86951dca03baa447fd5a58005ba47a098 (diff) | |
download | rockbox-484a79fcc0bb762acc1c3a502b237a68588ab4ab.tar.gz rockbox-484a79fcc0bb762acc1c3a502b237a68588ab4ab.zip |
x1000: Add INIT_ATTR to various target specific functions
Add INIT_ATTR to some low-hanging fruit in the X1000 code:
GPIO init, GPIO initial state tables, clock init, and DMA init.
Change-Id: Ia02b20945da1bbed103e2e01eaf60553eb5f72d4
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/clk-x1000.h')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/clk-x1000.h | 13 |
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); | |||
67 | extern const char* clk_get_name(x1000_clk_t clk); | 68 | extern const char* clk_get_name(x1000_clk_t clk); |
68 | 69 | ||
69 | /* Clock initialization */ | 70 | /* Clock initialization */ |
70 | extern void clk_init_early(void); | 71 | extern void clk_init_early(void) INIT_ATTR; |
71 | extern void clk_init(void); | 72 | extern void clk_init(void) INIT_ATTR; |
72 | 73 | ||
73 | /* Sets system clock multiplexers */ | 74 | /* Sets system clock multiplexers */ |
74 | extern void clk_set_ccr_mux(uint32_t muxbits); | 75 | extern void clk_set_ccr_mux(uint32_t muxbits) INIT_ATTR; |
75 | 76 | ||
76 | /* Sets system clock dividers */ | 77 | /* Sets system clock dividers */ |
77 | extern void clk_set_ccr_div(uint32_t divbits); | 78 | extern 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 */ |
80 | extern void clk_set_ddr(x1000_clk_t src, uint32_t div); | 81 | extern 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 */ |
83 | static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) | 84 | static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) |