SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Classes | Functions
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:

Classes

struct  core_pll_freq_fact
 

Functions

static void set_bit (uint32_t cpux, u8 bit)
 
static void clear_bit (uint32_t cpux, u8 bit)
 
static void enable_pll (uint32_t cpux, core_pll_freq_fact *CPUx, uint32_t default_val)
 
static void set_pll_cpux_axi (void)
 
static void set_pll_periph0 (void)
 
static void set_pll_periph1 (void)
 
static void set_ahb (void)
 
static void set_apb (void)
 
static void set_pll_dma (void)
 
static void set_pll_mbus (void)
 
static void set_circuits_analog (void)
 
static void set_iommu_auto_gating (void)
 
static void set_platform_config (void)
 
static void set_modules_clock (void)
 
void sunxi_clk_init (void)
 Initialize the global clocks.
 
void sunxi_clk_reset (void)
 Reset the global clocks.
 
uint32_t sunxi_clk_get_peri1x_rate ()
 Get the clock rate of the PERI1X bus.
 
void sunxi_clk_set_cpu_pll (uint32_t freq)
 Change the cpu freq.
 
static void sunxi_cpux_clk_dump (uint8_t cpuid, uint32_t cpu_reg)
 
void sunxi_clk_dump ()
 Dump all clock-related register values.
 

Function Documentation

◆ clear_bit()

static void clear_bit ( uint32_t  cpux,
u8  bit 
)
static

◆ enable_pll()

static void enable_pll ( uint32_t  cpux,
core_pll_freq_fact CPUx,
uint32_t  default_val 
)
static

◆ set_ahb()

static void set_ahb ( void  )
static

◆ set_apb()

static void set_apb ( void  )
static

◆ set_bit()

static void set_bit ( uint32_t  cpux,
u8  bit 
)
static

◆ set_circuits_analog()

static void set_circuits_analog ( void  )
static

◆ set_iommu_auto_gating()

static void set_iommu_auto_gating ( void  )
inlinestatic

◆ set_modules_clock()

static void set_modules_clock ( void  )
static

◆ set_platform_config()

static void set_platform_config ( void  )
static

◆ set_pll_cpux_axi()

static void set_pll_cpux_axi ( void  )
static

◆ set_pll_dma()

static void set_pll_dma ( void  )
static

◆ set_pll_mbus()

static void set_pll_mbus ( void  )
static

◆ set_pll_periph0()

static void set_pll_periph0 ( void  )
static

◆ set_pll_periph1()

static void set_pll_periph1 ( 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_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_reset()

void sunxi_clk_reset ( void  )

Reset the global clocks.

This function resets all global clocks to their default values.

◆ sunxi_clk_set_cpu_pll()

void sunxi_clk_set_cpu_pll ( uint32_t  freq)

Change the cpu freq.

Parameters
freqThe freq of cpu want to set.

◆ sunxi_cpux_clk_dump()

static void sunxi_cpux_clk_dump ( uint8_t  cpuid,
uint32_t  cpu_reg 
)
static