baytrail: add dunit access and registers
The dunit on baytrail is the dram unit. Provide a means to access the configuration registers there using the proper IOSF mechanisms. BUG=chrome-os-partner:22875 BRANCH=none TEST=Built and booted. Able to read dram registers. Change-Id: I4d5c019720a7883fe93f3e1860bcd57ce2ea6542 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170490 Reviewed-on: http://review.coreboot.org/4853 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Aaron Durbin
parent
191570ded8
commit
4c53df4730
@@ -59,3 +59,24 @@ void iosf_bunit_write(int reg, uint32_t val)
|
||||
write_iosf_reg(MCR_REG, cr);
|
||||
write_iosf_reg(MDR_REG, val);
|
||||
}
|
||||
|
||||
uint32_t iosf_dunit_read(int reg)
|
||||
{
|
||||
uint32_t cr = IOSF_OPCODE(IOSF_OP_READ_SYSMEMC) |
|
||||
IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) |
|
||||
IOSF_BYTE_EN;
|
||||
|
||||
write_iosf_reg(MCR_REG, cr);
|
||||
return read_iosf_reg(MDR_REG);
|
||||
}
|
||||
|
||||
void iosf_dunit_write(int reg, uint32_t val)
|
||||
{
|
||||
uint32_t cr = IOSF_OPCODE(IOSF_OP_WRITE_SYSMEMC) |
|
||||
IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) |
|
||||
IOSF_BYTE_EN;
|
||||
|
||||
|
||||
write_iosf_reg(MCR_REG, cr);
|
||||
write_iosf_reg(MDR_REG, val);
|
||||
}
|
||||
|
Reference in New Issue
Block a user