aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/sb_util.c
diff options
context:
space:
mode:
authorMarshall Dawson <marshalldawson3rd@gmail.com>2018-01-24 21:00:55 -0700
committerMartin Roth <martinroth@google.com>2018-01-26 22:38:05 +0000
commit50cc53d0a9189ad6c58a5160676703a7f2853ef5 (patch)
tree321fe7a27bb58f08bccb2910a901c1e58484a0ac /src/soc/amd/stoneyridge/sb_util.c
parent7539b8c3914ca949b2cb1172f3c9c539cee48d4b (diff)
amd/stoneyridge: Convert BiosRam access to MMIO
Change the BiosRam read/write functions to use the fixed MMIO range at 0xfed80500. This is faster than two accesses per byte when using I/O 0xcd4/0xcd5. Note that BiosRam may only be accessed byte-by-byte. It does not decode normally. Change-Id: I9d8baf2bd5d9d48a87bddfb6a0b86e292a8fdf7d Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/23436 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/soc/amd/stoneyridge/sb_util.c')
-rw-r--r--src/soc/amd/stoneyridge/sb_util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/soc/amd/stoneyridge/sb_util.c b/src/soc/amd/stoneyridge/sb_util.c
index 5238506199..a98a334fe2 100644
--- a/src/soc/amd/stoneyridge/sb_util.c
+++ b/src/soc/amd/stoneyridge/sb_util.c
@@ -78,16 +78,15 @@ void smi_write8(uint8_t offset, uint8_t value)
uint8_t biosram_read8(uint8_t offset)
{
- outb(offset, BIOSRAM_INDEX);
- return inb(BIOSRAM_DATA);
+ return read8((void *)(BIOSRAM_MMIO_BASE + offset));
}
void biosram_write8(uint8_t offset, uint8_t value)
{
- outb(offset, BIOSRAM_INDEX);
- outb(value, BIOSRAM_DATA);
+ write8((void *)(BIOSRAM_MMIO_BASE + offset), value);
}
+/* BiosRam may only be accessed a byte at a time */
uint16_t biosram_read16(uint8_t offset)
{
int i;