![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <soc/addressmap.h>
#include <soc/pmif.h>
#include <types.h>
Go to the source code of this file.
Data Structures | |
struct | mtk_pmicspi_mst_regs |
Macros | |
#define | PMIF_SPI_HW_INF 0x307F |
#define | PMIF_SPI_MD BIT(8) |
#define | PMIF_SPI_AP_SECURE BIT(9) |
#define | PMIF_SPI_AP BIT(10) |
#define | PMIF_SPI_STAUPD BIT(14) |
#define | PMIF_SPI_TSX_HW BIT(19) |
#define | PMIF_SPI_DCXO_HW BIT(20) |
#define | DEFAULT_SLVID 0 |
#define | PMIF_CMD_STA BIT(2) |
#define | SPIMST_STA BIT(9) |
Enumerations | |
enum | { PMIC_BASE = 0x0000 , PMIC_SMT_CON1 = PMIC_BASE + 0x0032 , PMIC_DRV_CON1 = PMIC_BASE + 0x003a , PMIC_FILTER_CON0 = PMIC_BASE + 0x0042 , PMIC_GPIO_PULLEN0_CLR = PMIC_BASE + 0x0098 , PMIC_RG_SPI_CON0 = PMIC_BASE + 0x0408 , PMIC_DEW_DIO_EN = PMIC_BASE + 0x040c , PMIC_DEW_READ_TEST = PMIC_BASE + 0x040e , PMIC_DEW_WRITE_TEST = PMIC_BASE + 0x0410 , PMIC_DEW_CRC_EN = PMIC_BASE + 0x0414 , PMIC_DEW_CRC_VAL = PMIC_BASE + 0x0416 , PMIC_DEW_RDDMY_NO = PMIC_BASE + 0x0424 , PMIC_RG_SPI_CON2 = PMIC_BASE + 0x0426 , PMIC_SPISLV_KEY = PMIC_BASE + 0x044a , PMIC_INT_STA = PMIC_BASE + 0x0452 , PMIC_AUXADC_ADC7 = PMIC_BASE + 0x1096 , PMIC_AUXADC_ADC10 = PMIC_BASE + 0x109c , PMIC_AUXADC_RQST0 = PMIC_BASE + 0x1108 } |
enum | { SPI_CLK = 0x1 , SPI_CSN = 0x1 << 1 , SPI_MOSI = 0x1 << 2 , SPI_MISO = 0x1 << 3 , SPI_FILTER = (SPI_CLK | SPI_CSN | SPI_MOSI | SPI_MISO) << 4 , SPI_SMT = SPI_CLK | SPI_CSN | SPI_MOSI | SPI_MISO , SPI_PULL_DISABLE = (SPI_CLK | SPI_CSN | SPI_MOSI | SPI_MISO) << 4 } |
enum | { SLV_IO_4_MA = 0x8 } |
enum | { SPI_CLK_SHIFT = 0 , SPI_CSN_SHIFT = 4 , SPI_MOSI_SHIFT = 8 , SPI_MISO_SHIFT = 12 , SPI_DRIVING } |
enum | { OP_WR = 0x1 , OP_CSH = 0x0 , OP_CSL = 0x1 , OP_OUTS = 0x8 } |
enum | { DEFAULT_VALUE_READ_TEST = 0x5aa5 , WRITE_TEST_VALUE = 0xa55a } |
enum | { DUMMY_READ_CYCLES = 0x8 } |
enum | { E_CLK_EDGE = 1 , E_CLK_LAST_SETTING } |
Functions | |
check_member (mtk_pmicspi_mst_regs, other_busy_sta_0, 0x10) | |
check_member (mtk_pmicspi_mst_regs, man_en, 0x20) | |
check_member (mtk_pmicspi_mst_regs, mux_sel, 0x34) | |
check_member (mtk_pmicspi_mst_regs, dio_en, 0x44) | |
int | pmif_spi_init (struct pmif *arb) |
void | pmif_spi_iocfg (void) |
Variables | |
static struct mtk_pmicspi_mst_regs *const | mtk_pmicspi_mst = (void *)PMICSPI_MST_BASE |
#define DEFAULT_SLVID 0 |
Definition at line 68 of file pmif_spi.h.
#define PMIF_CMD_STA BIT(2) |
Definition at line 70 of file pmif_spi.h.
#define PMIF_SPI_AP BIT(10) |
Definition at line 63 of file pmif_spi.h.
#define PMIF_SPI_AP_SECURE BIT(9) |
Definition at line 62 of file pmif_spi.h.
#define PMIF_SPI_DCXO_HW BIT(20) |
Definition at line 66 of file pmif_spi.h.
#define PMIF_SPI_HW_INF 0x307F |
Definition at line 60 of file pmif_spi.h.
#define PMIF_SPI_MD BIT(8) |
Definition at line 61 of file pmif_spi.h.
#define PMIF_SPI_STAUPD BIT(14) |
Definition at line 64 of file pmif_spi.h.
#define PMIF_SPI_TSX_HW BIT(19) |
Definition at line 65 of file pmif_spi.h.
#define SPIMST_STA BIT(9) |
Definition at line 71 of file pmif_spi.h.
anonymous enum |
Definition at line 39 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
SPI_CLK | |
SPI_CSN | |
SPI_MOSI | |
SPI_MISO | |
SPI_FILTER | |
SPI_SMT | |
SPI_PULL_DISABLE |
Definition at line 73 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
SLV_IO_4_MA |
Definition at line 83 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
SPI_CLK_SHIFT | |
SPI_CSN_SHIFT | |
SPI_MOSI_SHIFT | |
SPI_MISO_SHIFT | |
SPI_DRIVING |
Definition at line 87 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
OP_WR | |
OP_CSH | |
OP_CSL | |
OP_OUTS |
Definition at line 96 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_VALUE_READ_TEST | |
WRITE_TEST_VALUE |
Definition at line 103 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
DUMMY_READ_CYCLES |
Definition at line 108 of file pmif_spi.h.
anonymous enum |
Enumerator | |
---|---|
E_CLK_EDGE | |
E_CLK_LAST_SETTING |
Definition at line 112 of file pmif_spi.h.
check_member | ( | mtk_pmicspi_mst_regs | , |
dio_en | , | ||
0x44 | |||
) |
check_member | ( | mtk_pmicspi_mst_regs | , |
man_en | , | ||
0x20 | |||
) |
check_member | ( | mtk_pmicspi_mst_regs | , |
mux_sel | , | ||
0x34 | |||
) |
check_member | ( | mtk_pmicspi_mst_regs | , |
other_busy_sta_0 | , | ||
0x10 | |||
) |
int pmif_spi_init | ( | struct pmif * | arb | ) |
Definition at line 275 of file pmif_spi.c.
References mtk_pmif_regs::arb_en, BIOS_ERR, DEFAULT_SLVID, E_SPI_INIT_RESET_SPI, E_SPI_INIT_SIDLY, mtk_pmif_regs::inf_en, mtk_pmif_regs::init_done, init_reg_clock(), init_sistrobe(), init_spislv(), init_staupd(), mtk_pmicspi_mst, pmif::mtk_pmif, mtk_pmif_regs::other_inf_en, PMIC_SPISLV_KEY, PMIF_SPI_AP, PMIF_SPI_AP_SECURE, pmif_spi_config(), PMIF_SPI_DCXO_HW, PMIF_SPI_HW_INF, PMIF_SPI_MD, PMIF_SPI_STAUPD, PMIF_SPI_TSX_HW, printk, reset_spislv(), SET32_BITFIELDS, mtk_pmif_regs::timer_ctrl, mtk_pmicspi_mst_regs::wrap_en, pmif::write, and write32().
Referenced by mtk_pmif_init().
Definition at line 10 of file pmif_spi.c.
References IO_4_MA, IO_6_MA, mtk_iocfg_bm, mtk_iocfg_lm, and SET32_BITFIELDS.
Referenced by init_reg_clock().
|
static |
Definition at line 36 of file pmif_spi.h.
Referenced by init_reg_clock(), init_sistrobe(), init_staupd(), pmif_spi_init(), and reset_spislv().