<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25619">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">drivers/asmedia: Add ASPM blacklist<br><br>To be selected by mainboard Kconfig.<br><br>Change-Id: I05f9789bc14db56d2ac085f4f14047d80c3aefb5<br>Signed-off-by: Nico Huber <nico.huber@secunet.com><br>---<br>A src/drivers/asmedia/Kconfig<br>A src/drivers/asmedia/Makefile.inc<br>A src/drivers/asmedia/aspm_blacklist.c<br>3 files changed, 61 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/25619/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/drivers/asmedia/Kconfig b/src/drivers/asmedia/Kconfig</span><br><span>new file mode 100644</span><br><span>index 0000000..e0a0ca3</span><br><span>--- /dev/null</span><br><span>+++ b/src/drivers/asmedia/Kconfig</span><br><span>@@ -0,0 +1,2 @@</span><br><span style="color: hsl(120, 100%, 40%);">+config DRIVERS_ASMEDIA_ASPM_BLACKLIST</span><br><span style="color: hsl(120, 100%, 40%);">+     bool</span><br><span>diff --git a/src/drivers/asmedia/Makefile.inc b/src/drivers/asmedia/Makefile.inc</span><br><span>new file mode 100644</span><br><span>index 0000000..daa4e89</span><br><span>--- /dev/null</span><br><span>+++ b/src/drivers/asmedia/Makefile.inc</span><br><span>@@ -0,0 +1,16 @@</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2018 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+## it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+## the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+## but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+## GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-$(CONFIG_DRIVERS_ASMEDIA_ASPM_BLACKLIST) += aspm_blacklist.c</span><br><span>diff --git a/src/drivers/asmedia/aspm_blacklist.c b/src/drivers/asmedia/aspm_blacklist.c</span><br><span>new file mode 100644</span><br><span>index 0000000..eb3a60a</span><br><span>--- /dev/null</span><br><span>+++ b/src/drivers/asmedia/aspm_blacklist.c</span><br><span>@@ -0,0 +1,43 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2018 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <console/console.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <device/device.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <device/pci.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void disable_aspm(struct device *const dev)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        printk(BIOS_DEBUG, "Disabling ASPM for %s [%04x/%04x]\n",</span><br><span style="color: hsl(120, 100%, 40%);">+          dev_path(dev), dev->vendor, dev->device);</span><br><span style="color: hsl(120, 100%, 40%);">+        dev->disable_pcie_aspm = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static struct device_operations asmedia_noaspm_ops = {</span><br><span style="color: hsl(120, 100%, 40%);">+   .read_resources         = pci_dev_read_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+     .set_resources          = pci_dev_set_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+      .enable_resources       = pci_dev_enable_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+   .enable                 = disable_aspm,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const unsigned short pci_device_ids[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+       0x0611,</span><br><span style="color: hsl(120, 100%, 40%);">+       0</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const struct pci_driver asmedia_noaspm __pci_driver = {</span><br><span style="color: hsl(120, 100%, 40%);">+       .ops     = &asmedia_noaspm_ops,</span><br><span style="color: hsl(120, 100%, 40%);">+   .vendor  = 0x1b21,</span><br><span style="color: hsl(120, 100%, 40%);">+    .devices = pci_device_ids,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25619">change 25619</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/25619"/><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: I05f9789bc14db56d2ac085f4f14047d80c3aefb5 </div>
<div style="display:none"> Gerrit-Change-Number: 25619 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>