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>
This commit is contained in:
parent
0b132c3ae3
commit
3f5a1ffb83
|
@ -58,6 +58,8 @@ uint32_t iosf_bunit_read(int reg);
|
||||||
void iosf_bunit_write(int reg, uint32_t val);
|
void iosf_bunit_write(int reg, uint32_t val);
|
||||||
uint32_t iosf_dunit_read(int reg);
|
uint32_t iosf_dunit_read(int reg);
|
||||||
void iosf_dunit_write(int reg, uint32_t val);
|
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. */
|
/* IOSF ports. */
|
||||||
#define IOSF_PORT_AUNIT 0x00 /* IO Arbiter unit */
|
#define IOSF_PORT_AUNIT 0x00 /* IO Arbiter unit */
|
||||||
|
|
|
@ -76,6 +76,25 @@ void iosf_dunit_write(int reg, uint32_t val)
|
||||||
IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) |
|
IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) |
|
||||||
IOSF_BYTE_EN;
|
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(MCR_REG, cr);
|
||||||
write_iosf_reg(MDR_REG, val);
|
write_iosf_reg(MDR_REG, val);
|
||||||
|
|
Loading…
Reference in New Issue