summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/clk-x1000.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-07-06 21:02:37 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-07-08 16:01:38 +0000
commit0e1a90ea1da0c1737363e9412781f734f39048d4 (patch)
treebef444477385a5eb8e8766ec75391ba48d63c613 /firmware/target/mips/ingenic_x1000/clk-x1000.h
parent65aa9ce57067f810d6a8f9417ec7d0a5741b404a (diff)
downloadrockbox-0e1a90ea1da0c1737363e9412781f734f39048d4.tar.gz
rockbox-0e1a90ea1da0c1737363e9412781f734f39048d4.zip
x1000: SPL refactoring
This streamlines the boot code a bit and reduces target specific boilerplate. The clock init hack used by the bootloader has been "standardized" and works for the main Rockbox binary now, so you can boot rockbox.bin over USB without special hacks. Change-Id: I7c1fac37df5a45873583ce6818eaedb9f71a782b
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, 12 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/clk-x1000.h b/firmware/target/mips/ingenic_x1000/clk-x1000.h
index 2ff602db9f..e19c56d0ba 100644
--- a/firmware/target/mips/ingenic_x1000/clk-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/clk-x1000.h
@@ -31,6 +31,13 @@
31#define CLKMUX_AHB0(x) jz_orf(CPM_CCR, SEL_H0PLL_V(x)) 31#define CLKMUX_AHB0(x) jz_orf(CPM_CCR, SEL_H0PLL_V(x))
32#define CLKMUX_AHB2(x) jz_orf(CPM_CCR, SEL_H2PLL_V(x)) 32#define CLKMUX_AHB2(x) jz_orf(CPM_CCR, SEL_H2PLL_V(x))
33 33
34/* Arguments to clk_set_ccr_div() */
35#define CLKDIV_CPU(x) jz_orf(CPM_CCR, CDIV((x) - 1))
36#define CLKDIV_L2(x) jz_orf(CPM_CCR, L2DIV((x) - 1))
37#define CLKDIV_AHB0(x) jz_orf(CPM_CCR, H0DIV((x) - 1))
38#define CLKDIV_AHB2(x) jz_orf(CPM_CCR, H2DIV((x) - 1))
39#define CLKDIV_PCLK(x) jz_orf(CPM_CCR, PDIV((x) - 1))
40
34typedef enum x1000_clk_t { 41typedef enum x1000_clk_t {
35 X1000_CLK_EXCLK, 42 X1000_CLK_EXCLK,
36 X1000_CLK_APLL, 43 X1000_CLK_APLL,
@@ -59,11 +66,15 @@ extern uint32_t clk_get(x1000_clk_t clk);
59/* Get the name of a clock for debug purposes */ 66/* Get the name of a clock for debug purposes */
60extern const char* clk_get_name(x1000_clk_t clk); 67extern const char* clk_get_name(x1000_clk_t clk);
61 68
69/* Clock initialization */
70extern void clk_init_early(void);
71extern void clk_init(void);
72
62/* Sets system clock multiplexers */ 73/* Sets system clock multiplexers */
63extern void clk_set_ccr_mux(uint32_t muxbits); 74extern void clk_set_ccr_mux(uint32_t muxbits);
64 75
65/* Sets system clock dividers */ 76/* Sets system clock dividers */
66extern void clk_set_ccr_div(int cpu, int l2, int ahb0, int ahb2, int pclk); 77extern void clk_set_ccr_div(uint32_t divbits);
67 78
68/* Sets DDR clock source and divider */ 79/* Sets DDR clock source and divider */
69extern void clk_set_ddr(x1000_clk_t src, uint32_t div); 80extern void clk_set_ddr(x1000_clk_t src, uint32_t div);