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

Go to the source code of this file.

Data Structures

struct  mtk_rgu_regs
 
struct  mtk_spmi_mst_reg
 
struct  cali
 

Macros

#define DEFAULT_VALUE_READ_TEST   (0x5a)
 
#define DEFAULT_VALUE_WRITE_TEST   (0xa5)
 
#define PMIF_SPMI_SW_CHAN   BIT(6)
 
#define PMIF_SPMI_INF   0x2F7
 
#define mtk_rug   ((struct mtk_rgu_regs *)RGU_BASE)
 
#define mtk_spmi_mst   ((struct mtk_spmi_mst_reg *)SPMI_MST_BASE)
 
#define MT6315_DEFAULT_VALUE_READ   0x15
 

Enumerations

enum  { SPMI_CK_NO_DLY = 0 , SPMI_CK_DLY_1T }
 
enum  { SPMI_CK_POL_NEG = 0 , SPMI_CK_POL_POS }
 
enum  spmi_regs {
  SPMI_OP_ST_CTRL , SPMI_GRP_ID_EN , SPMI_OP_ST_STA , SPMI_MST_SAMPL ,
  SPMI_MST_REQ_EN , SPMI_REC_CTRL , SPMI_REC0 , SPMI_REC1 ,
  SPMI_REC2 , SPMI_REC3 , SPMI_REC4 , SPMI_MST_DBG
}
 
enum  { MT6315_BASE = 0x0 , MT6315_READ_TEST = MT6315_BASE + 0x9 , MT6315_READ_TEST_1 = MT6315_BASE + 0xb }
 

Functions

 check_member (mtk_rgu_regs, wdt_swsysrst2, 0x90)
 
 check_member (mtk_spmi_mst_reg, rec_ctrl, 0x40)
 
 check_member (mtk_spmi_mst_reg, mst_dbg, 0xfc)
 
int pmif_spmi_init (struct pmif *arb)
 
int spmi_config_master (void)
 
void pmif_spmi_iocfg (void)
 

Macro Definition Documentation

◆ DEFAULT_VALUE_READ_TEST

#define DEFAULT_VALUE_READ_TEST   (0x5a)

Definition at line 9 of file pmif_spmi.h.

◆ DEFAULT_VALUE_WRITE_TEST

#define DEFAULT_VALUE_WRITE_TEST   (0xa5)

Definition at line 10 of file pmif_spmi.h.

◆ MT6315_DEFAULT_VALUE_READ

#define MT6315_DEFAULT_VALUE_READ   0x15

Definition at line 83 of file pmif_spmi.h.

◆ mtk_rug

#define mtk_rug   ((struct mtk_rgu_regs *)RGU_BASE)

Definition at line 43 of file pmif_spmi.h.

◆ mtk_spmi_mst

#define mtk_spmi_mst   ((struct mtk_spmi_mst_reg *)SPMI_MST_BASE)

Definition at line 44 of file pmif_spmi.h.

◆ PMIF_SPMI_INF

#define PMIF_SPMI_INF   0x2F7

Definition at line 14 of file pmif_spmi.h.

◆ PMIF_SPMI_SW_CHAN

#define PMIF_SPMI_SW_CHAN   BIT(6)

Definition at line 13 of file pmif_spmi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SPMI_CK_NO_DLY 
SPMI_CK_DLY_1T 

Definition at line 51 of file pmif_spmi.h.

◆ anonymous enum

anonymous enum
Enumerator
SPMI_CK_POL_NEG 
SPMI_CK_POL_POS 

Definition at line 56 of file pmif_spmi.h.

◆ anonymous enum

anonymous enum
Enumerator
MT6315_BASE 
MT6315_READ_TEST 
MT6315_READ_TEST_1 

Definition at line 77 of file pmif_spmi.h.

◆ spmi_regs

enum spmi_regs
Enumerator
SPMI_OP_ST_CTRL 
SPMI_GRP_ID_EN 
SPMI_OP_ST_STA 
SPMI_MST_SAMPL 
SPMI_MST_REQ_EN 
SPMI_REC_CTRL 
SPMI_REC0 
SPMI_REC1 
SPMI_REC2 
SPMI_REC3 
SPMI_REC4 
SPMI_MST_DBG 

Definition at line 61 of file pmif_spmi.h.

Function Documentation

◆ check_member() [1/3]

check_member ( mtk_rgu_regs  ,
wdt_swsysrst2  ,
0x90   
)

◆ check_member() [2/3]

check_member ( mtk_spmi_mst_reg  ,
mst_dbg  ,
0xfc   
)

◆ check_member() [3/3]

check_member ( mtk_spmi_mst_reg  ,
rec_ctrl  ,
0x40   
)

◆ pmif_spmi_init()

int pmif_spmi_init ( struct pmif arb)

Definition at line 186 of file pmif_spmi.c.

References BIOS_ERR, E_NODEV, pmif::is_pmif_init_done, pmif::mstid, pmif_spmi_enable(), pmif_spmi_enable_cmdIssue(), pmif_spmi_enable_swinf(), pmif_spmi_force_normal_mode(), printk, and spmi_mst_init().

Referenced by mtk_pmif_init().

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

◆ pmif_spmi_iocfg()

void pmif_spmi_iocfg ( void  )

Definition at line 44 of file pmif_spmi.c.

References mtk_iocfg_bm, and SET32_BITFIELDS.

Referenced by spmi_mst_init().

Here is the caller graph for this function:

◆ spmi_config_master()

int spmi_config_master ( void  )

Definition at line 24 of file pmif_spmi.c.

References mtk_rug, mtk_spmi_mst, mtk_topckgen, SET32_BITFIELDS, and write32().

Referenced by spmi_mst_init().

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