<p><a href="https://review.coreboot.org/25750">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://review.coreboot.org/#/c/25750/1/src/soc/cavium/cn81xx/ecam0.c">File src/soc/cavium/cn81xx/ecam0.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://review.coreboot.org/#/c/25750/1/src/soc/cavium/cn81xx/ecam0.c@20">Patch Set #1, Line 20:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">/*<br> * Functions for accessing PCI configuration space with mmconf accesses<br> */<br>#define PCI_MMIO_ADDR(SEGBUS, DEVFN, WHERE, MASK)   \<br>                     ((void *)(((uintptr_t)ECAM_PF_BAR2 |\<br>                            (((SEGBUS) & 0xFFF) << 20) |\<br>                               (((DEVFN) & 0xFF) << 12) |\<br>                                 ((WHERE) & 0xFFF)) & ~MASK))<br><br>static uint8_t pci_mmconf_read_config8(struct bus *pbus, int bus, int devfn,<br>                                      int where)<br>{<br>  return read8(PCI_MMIO_ADDR(bus, devfn, where, 0));<br>}<br><br>static uint16_t pci_mmconf_read_config16(struct bus *pbus, int bus, int devfn,<br>                                        int where)<br>{<br>        return read16(PCI_MMIO_ADDR(bus, devfn, where, 1));<br>}<br><br>static uint32_t pci_mmconf_read_config32(struct bus *pbus, int bus, int devfn,<br>                                       int where)<br>{<br>        return read32(PCI_MMIO_ADDR(bus, devfn, where, 3));<br>}<br><br>static void pci_mmconf_write_config8(struct bus *pbus, int bus, int devfn,<br>                               int where, uint8_t value)<br>{<br>     write8(PCI_MMIO_ADDR(bus, devfn, where, 0), value);<br>}<br><br>static void pci_mmconf_write_config16(struct bus *pbus, int bus, int devfn,<br>                               int where, uint16_t value)<br>{<br>   write16(PCI_MMIO_ADDR(bus, devfn, where, 1), value);<br>}<br><br>static void pci_mmconf_write_config32(struct bus *pbus, int bus, int devfn,<br>                                      int where, uint32_t value)<br>{<br>   write32(PCI_MMIO_ADDR(bus, devfn, where, 3), value);<br>}<br><br>static const struct pci_bus_operations pci_ops_ecam0_mmconf = {<br>    .read8 = pci_mmconf_read_config8,<br>     .read16 = pci_mmconf_read_config16,<br>   .read32 = pci_mmconf_read_config32,<br>   .write8 = pci_mmconf_write_config8,<br>   .write16 = pci_mmconf_write_config16,<br> .write32 = pci_mmconf_write_config32,<br>};<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Looks like a copy of `src/arch/x86/pci_ops_mmconf.c`. Obviously<br>not architecture specific. But copying it into a specific SoC<br>implementation makes the situation even worse.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The x86 implementation should just move to a generic place.</p></li></ul></li></ul><p>To view, visit <a href="https://review.coreboot.org/25750">change 25750</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/25750"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: I881f38a26a165e6bd965fcd73547473b5e32d4b0 </div>
<div style="display:none"> Gerrit-Change-Number: 25750 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com> </div>
<div style="display:none"> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> </div>
<div style="display:none"> Gerrit-CC: Nico Huber <nico.h@gmx.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 04 May 2018 13:39:52 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>