coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dpm.h File Reference
#include <soc/addressmap.h>
#include <soc/mcu_common.h>
#include <types.h>
Include dependency graph for dpm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpm_regs
 

Macros

#define DPM_SW_RSTN_RESET   BIT(0)
 
#define DPM_MEM_RATIO_OFFSET   28
 
#define DPM_MEM_RATIO_MASK   (0x3 << DPM_MEM_RATIO_OFFSET)
 
#define DPM_MEM_RATIO_CFG1   (1 << DPM_MEM_RATIO_OFFSET)
 
#define DRAMC_MCU_SRAM_ISOINT_B_LSB   BIT(1)
 
#define DRAMC_MCU2_SRAM_ISOINT_B_LSB   BIT(1)
 
#define DRAMC_MCU_SRAM_SLEEP_B_LSB   BIT(4)
 
#define DRAMC_MCU2_SRAM_SLEEP_B_LSB   BIT(4)
 

Functions

 check_member (dpm_regs, mclk_div, 0x3004)
 
 check_member (dpm_regs, twam_window_len, 0x6004)
 
 check_member (dpm_regs, low_power_cfg_0, 0x7004)
 
 check_member (dpm_regs, low_power_cfg_1, 0x7008)
 
 check_member (dpm_regs, fsm_out_ctrl_0, 0x7010)
 
 check_member (dpm_regs, fsm_cfg_1, 0x7034)
 
 check_member (dpm_regs, low_power_cfg_3, 0x7038)
 
 check_member (dpm_regs, dfd_dbug_0, 0x703C)
 
 check_member (dpm_regs, status_4, 0x70B0)
 
void dpm_reset (struct mtk_mcu *mcu)
 
int dpm_init (void)
 
int dpm_4ch_para_setting (void)
 
int dpm_4ch_init (void)
 

Variables

static struct dpm_regs *const mtk_dpm = (void *)DPM_CFG_BASE
 

Macro Definition Documentation

◆ DPM_MEM_RATIO_CFG1

#define DPM_MEM_RATIO_CFG1   (1 << DPM_MEM_RATIO_OFFSET)

Definition at line 43 of file dpm.h.

◆ DPM_MEM_RATIO_MASK

#define DPM_MEM_RATIO_MASK   (0x3 << DPM_MEM_RATIO_OFFSET)

Definition at line 42 of file dpm.h.

◆ DPM_MEM_RATIO_OFFSET

#define DPM_MEM_RATIO_OFFSET   28

Definition at line 41 of file dpm.h.

◆ DPM_SW_RSTN_RESET

#define DPM_SW_RSTN_RESET   BIT(0)

Definition at line 40 of file dpm.h.

◆ DRAMC_MCU2_SRAM_ISOINT_B_LSB

#define DRAMC_MCU2_SRAM_ISOINT_B_LSB   BIT(1)

Definition at line 45 of file dpm.h.

◆ DRAMC_MCU2_SRAM_SLEEP_B_LSB

#define DRAMC_MCU2_SRAM_SLEEP_B_LSB   BIT(4)

Definition at line 47 of file dpm.h.

◆ DRAMC_MCU_SRAM_ISOINT_B_LSB

#define DRAMC_MCU_SRAM_ISOINT_B_LSB   BIT(1)

Definition at line 44 of file dpm.h.

◆ DRAMC_MCU_SRAM_SLEEP_B_LSB

#define DRAMC_MCU_SRAM_SLEEP_B_LSB   BIT(4)

Definition at line 46 of file dpm.h.

Function Documentation

◆ check_member() [1/9]

check_member ( dpm_regs  ,
dfd_dbug_0  ,
0x703C   
)

◆ check_member() [2/9]

check_member ( dpm_regs  ,
fsm_cfg_1  ,
0x7034   
)

◆ check_member() [3/9]

check_member ( dpm_regs  ,
fsm_out_ctrl_0  ,
0x7010   
)

◆ check_member() [4/9]

check_member ( dpm_regs  ,
low_power_cfg_0  ,
0x7004   
)

◆ check_member() [5/9]

check_member ( dpm_regs  ,
low_power_cfg_1  ,
0x7008   
)

◆ check_member() [6/9]

check_member ( dpm_regs  ,
low_power_cfg_3  ,
0x7038   
)

◆ check_member() [7/9]

check_member ( dpm_regs  ,
mclk_div  ,
0x3004   
)

◆ check_member() [8/9]

check_member ( dpm_regs  ,
status_4  ,
0x70B0   
)

◆ check_member() [9/9]

check_member ( dpm_regs  ,
twam_window_len  ,
0x6004   
)

◆ dpm_4ch_init()

int dpm_4ch_init ( void  )

Definition at line 67 of file dpm_4ch.c.

References dpm_mtcoms_sleep_on(), and wake_dpm_sram_up().

Referenced by dpm_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpm_4ch_para_setting()

int dpm_4ch_para_setting ( void  )

Definition at line 75 of file dpm_4ch.c.

References ARRAY_SIZE, mtk_mcu::buffer_size, dpm_mcu_4ch, mtk_mcu::load_buffer, mtk_init_mcu(), and REGION_SIZE.

Referenced by dpm_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpm_init()

int dpm_init ( void  )

Definition at line 33 of file dpm.c.

References ARRAY_SIZE, mtk_mcu::buffer_size, clrsetbits32, CONFIG, dpm_4ch_init(), dpm_4ch_para_setting(), dpm_mcu, DPM_MEM_RATIO_CFG1, DPM_MEM_RATIO_MASK, mtk_mcu::load_buffer, mtk_dpm, mtk_init_mcu(), REGION_SIZE, and dpm_regs::sw_rstn.

Referenced by mainboard_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpm_reset()

void dpm_reset ( struct mtk_mcu mcu)

Definition at line 21 of file dpm.c.

References DPM_SW_RSTN_RESET, mtk_mcu::priv, setbits32, dpm_regs::sw_rstn, dpm_regs::twam_mon_type, dpm_regs::twam_window_len, and write32().

Here is the call graph for this function:

Variable Documentation

◆ mtk_dpm

struct dpm_regs* const mtk_dpm = (void *)DPM_CFG_BASE
static

Definition at line 49 of file dpm.h.

Referenced by dpm_init().