summaryrefslogtreecommitdiff
path: root/src/soc/intel/baytrail/iosf.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-10-04 15:23:31 -0500
committerAaron Durbin <adurbin@google.com>2014-02-11 22:18:48 +0100
commit3f5a1ffb83895b325ec54ba0a6d0147f0af5fca8 (patch)
tree3f8b999eec046149de00788c350663ce2eaeca9c /src/soc/intel/baytrail/iosf.c
parent0b132c3ae3e36a94c594e171b6d17a06d8c759cf (diff)
downloadcoreboot-3f5a1ffb83895b325ec54ba0a6d0147f0af5fca8.tar.xz
baytrail: add punit access functions
Like the bunit and dunit, add the punit accessor functions. BUG=chrome-os-partner:23085 BRANCH=None TEST=Built. Change-Id: Ifd7184dfca8c0491c107bc1c562ea1ded444e372 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171931 Reviewed-on: http://review.coreboot.org/4867 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/soc/intel/baytrail/iosf.c')
-rw-r--r--src/soc/intel/baytrail/iosf.c19
1 files changed, 19 insertions, 0 deletions
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);