<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23436">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amd/stoneyridge: Convert BiosRam access to MMIO<br><br>Change the BiosRam read/write functions to use the fixed MMIO range at<br>0xfed80500.  This is faster than two accesses per byte when using I/O<br>0xcd4/0xcd5.<br><br>Note that BiosRam may only be accessed byte-by-byte.  It does not decode<br>normally.<br><br>Change-Id: I9d8baf2bd5d9d48a87bddfb6a0b86e292a8fdf7d<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/stoneyridge/include/soc/iomap.h<br>M src/soc/amd/stoneyridge/sb_util.c<br>2 files changed, 5 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/23436/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/include/soc/iomap.h b/src/soc/amd/stoneyridge/include/soc/iomap.h</span><br><span>index 2d42ad9..e121fa0 100644</span><br><span>--- a/src/soc/amd/stoneyridge/include/soc/iomap.h</span><br><span>+++ b/src/soc/amd/stoneyridge/include/soc/iomap.h</span><br><span>@@ -36,6 +36,7 @@</span><br><span> #define AMD_SB_ACPI_MMIO_ADDR              0xfed80000</span><br><span> #define APU_SMI_BASE                      0xfed80200</span><br><span> #define PM_MMIO_BASE                      0xfed80300</span><br><span style="color: hsl(120, 100%, 40%);">+#define BIOSRAM_MMIO_BASE           0xfed80500</span><br><span> #define XHCI_ACPI_PM_MMIO_BASE            0xfed81c00</span><br><span> #define APU_UART0_BASE                    0xfedc6000</span><br><span> #define APU_UART1_BASE                    0xfedc8000</span><br><span>diff --git a/src/soc/amd/stoneyridge/sb_util.c b/src/soc/amd/stoneyridge/sb_util.c</span><br><span>index 5238506..5e52a28 100644</span><br><span>--- a/src/soc/amd/stoneyridge/sb_util.c</span><br><span>+++ b/src/soc/amd/stoneyridge/sb_util.c</span><br><span>@@ -76,18 +76,18 @@</span><br><span>    write8((void *)(APU_SMI_BASE + offset), value);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> uint8_t biosram_read8(uint8_t offset)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        outb(offset, BIOSRAM_INDEX);</span><br><span style="color: hsl(0, 100%, 40%);">-    return inb(BIOSRAM_DATA);</span><br><span style="color: hsl(120, 100%, 40%);">+     return read8((void *)(BIOSRAM_MMIO_BASE + offset));</span><br><span> }</span><br><span> </span><br><span> void biosram_write8(uint8_t offset, uint8_t value)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- outb(offset, BIOSRAM_INDEX);</span><br><span style="color: hsl(0, 100%, 40%);">-    outb(value, BIOSRAM_DATA);</span><br><span style="color: hsl(120, 100%, 40%);">+    write8((void *)(BIOSRAM_MMIO_BASE + offset), value);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* BiosRam may only be accessed a byte at a time */</span><br><span> uint16_t biosram_read16(uint8_t offset)</span><br><span> {</span><br><span>   int i;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23436">change 23436</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23436"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9d8baf2bd5d9d48a87bddfb6a0b86e292a8fdf7d </div>
<div style="display:none"> Gerrit-Change-Number: 23436 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>