diff options
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/baytrail/baytrail/iosf.h | 2 | ||||
-rw-r--r-- | src/soc/intel/baytrail/iosf.c | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/soc/intel/baytrail/baytrail/iosf.h b/src/soc/intel/baytrail/baytrail/iosf.h index b1f28dad7f..cf7e559e72 100644 --- a/src/soc/intel/baytrail/baytrail/iosf.h +++ b/src/soc/intel/baytrail/baytrail/iosf.h @@ -58,6 +58,8 @@ uint32_t iosf_bunit_read(int reg); void iosf_bunit_write(int reg, uint32_t val); uint32_t iosf_dunit_read(int reg); void iosf_dunit_write(int reg, uint32_t val); +uint32_t iosf_punit_read(int reg); +void iosf_punit_write(int reg, uint32_t val); /* IOSF ports. */ #define IOSF_PORT_AUNIT 0x00 /* IO Arbiter unit */ diff --git a/src/soc/intel/baytrail/iosf.c b/src/soc/intel/baytrail/iosf.c index 2373d81598..00a3269da0 100644 --- a/src/soc/intel/baytrail/iosf.c +++ b/src/soc/intel/baytrail/iosf.c @@ -76,6 +76,25 @@ void iosf_dunit_write(int reg, uint32_t val) IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) | IOSF_BYTE_EN; + write_iosf_reg(MCR_REG, cr); + write_iosf_reg(MDR_REG, val); +} + +uint32_t iosf_punit_read(int reg) +{ + uint32_t cr = IOSF_OPCODE(IOSF_OP_READ_PMC) | + IOSF_PORT(IOSF_PORT_PMC) | IOSF_REG(reg) | + IOSF_BYTE_EN; + + write_iosf_reg(MCR_REG, cr); + return read_iosf_reg(MDR_REG); +} + +void iosf_punit_write(int reg, uint32_t val) +{ + uint32_t cr = IOSF_OPCODE(IOSF_OP_WRITE_PMC) | + IOSF_PORT(IOSF_PORT_PMC) | IOSF_REG(reg) | + IOSF_BYTE_EN; write_iosf_reg(MCR_REG, cr); write_iosf_reg(MDR_REG, val); |