SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions | Variables
sys-clk.c File Reference
#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <timer.h>
#include <log.h>
#include <sys-clk.h>
Include dependency graph for sys-clk.c:

Functions

static void set_pll_general (uint32_t pll_addr, uint32_t en, uint32_t output_gate_en, uint32_t pll_d, uint32_t pll_d_off, uint32_t pll_n)
 
static void set_pll_e90x (void)
 
static void set_pll_a27l2 (void)
 
static void set_pll_peri_ctrl0 (uint32_t en, uint32_t output_gate_en, uint32_t pll_n, uint32_t pll_m)
 
static void set_pll_peri_ctrl1 (void)
 
static void set_pll_peri (void)
 
static void set_pll_csi (void)
 
static void set_pll_video (void)
 
static void set_ahb (void)
 
static void set_apb (void)
 
static void set_apb_spec (void)
 
void sunxi_clk_init (void)
 Initialize the global clocks.
 
void sunxi_clk_pre_init (void)
 Initialize the necessary clocks for minsys boot up.
 
void sunxi_clk_dump ()
 Dump all clock-related register values.
 
uint32_t sunxi_clk_get_hosc_type ()
 Get the type of High-Speed Oscillator (HOSC).
 
uint32_t sunxi_clk_get_peri1x_rate ()
 Get the clock rate of the PERI1X bus.
 

Variables

uint32_t current_hosc_freq
 Current frequency of the high-speed oscillator (HOSC) in MHz.
 

Function Documentation

◆ set_ahb()

static void set_ahb ( void  )
static

◆ set_apb()

static void set_apb ( void  )
static

◆ set_apb_spec()

static void set_apb_spec ( void  )
static

◆ set_pll_a27l2()

static void set_pll_a27l2 ( void  )
static

◆ set_pll_csi()

static void set_pll_csi ( void  )
static

◆ set_pll_e90x()

static void set_pll_e90x ( void  )
static

◆ set_pll_general()

static void set_pll_general ( uint32_t  pll_addr,
uint32_t  en,
uint32_t  output_gate_en,
uint32_t  pll_d,
uint32_t  pll_d_off,
uint32_t  pll_n 
)
static

◆ set_pll_peri()

static void set_pll_peri ( void  )
static

◆ set_pll_peri_ctrl0()

static void set_pll_peri_ctrl0 ( uint32_t  en,
uint32_t  output_gate_en,
uint32_t  pll_n,
uint32_t  pll_m 
)
static

◆ set_pll_peri_ctrl1()

static void set_pll_peri_ctrl1 ( void  )
static

◆ set_pll_video()

static void set_pll_video ( void  )
static

◆ sunxi_clk_dump()

void sunxi_clk_dump ( void  )

Dump all clock-related register values.

This function prints out all clock-related register values for debugging and observation.

◆ sunxi_clk_get_hosc_type()

uint32_t sunxi_clk_get_hosc_type ( void  )

Get the type of High-Speed Oscillator (HOSC).

This function retrieves the type of the High-Speed Oscillator currently being used. The returned value can indicate different HOSC configurations or features supported by the system.

Returns
uint32_t Type of the HOSC.

◆ sunxi_clk_get_peri1x_rate()

uint32_t sunxi_clk_get_peri1x_rate ( )

Get the clock rate of the PERI1X bus.

Returns
The clock rate of the PERI1X bus in Hz.

◆ sunxi_clk_init()

void sunxi_clk_init ( void  )

Initialize the global clocks.

This function initializes the global clocks, including PLLs and clock dividers.

◆ sunxi_clk_pre_init()

void sunxi_clk_pre_init ( void  )

Initialize the necessary clocks for minsys boot up.

This function initializes the necessary clocks for minsys boot up clocks

Variable Documentation

◆ current_hosc_freq

uint32_t current_hosc_freq
extern

Current frequency of the high-speed oscillator (HOSC) in MHz.