Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/23663
Change subject: mb/kontron/986lcd-m: Disable ethernet devices in ramstage ......................................................................
mb/kontron/986lcd-m: Disable ethernet devices in ramstage
Move disabling PCIe ports and the respective ethernet port out of romstage.
Change-Id: Ic8abc4c8289f5e34bbb7d5ee57d9a2f404e26189 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/mainboard/kontron/986lcd-m/mainboard.c M src/mainboard/kontron/986lcd-m/romstage.c 2 files changed, 22 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/23663/1
diff --git a/src/mainboard/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c index d729533..5519f58 100644 --- a/src/mainboard/kontron/986lcd-m/mainboard.c +++ b/src/mainboard/kontron/986lcd-m/mainboard.c @@ -20,6 +20,8 @@ #include <pc80/mc146818rtc.h> #include <arch/io.h> #include <arch/interrupt.h> +#include <device/pci_def.h> +#include <string.h>
/* Hardware Monitor */
@@ -148,6 +150,25 @@ hwm_write(0x40, 0x01); /* Init, but no SMI# */ }
+static void disable_ethernet(void) +{ + struct device *dev; + int i; + + for (i = 0; i < 3; i++) { + char buffer[10]; + snprintf(buffer, sizeof(buffer), "ethernet%d", i + 1); + int disable_eth; + get_option(&disable_eth, buffer); + if (disable_eth) { + printk(BIOS_DEBUG, "Disabling ethernet adapter %d.\n", + i + 1); + dev = dev_find_slot(0, PCI_DEVFN(0x1c, i)); + dev->enabled = 0; + } + } +} + /* mainboard_enable is executed as first thing after */ /* enumerate_buses(). */
@@ -155,6 +176,7 @@ { install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3); hwm_setup(); + disable_ethernet(); }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/kontron/986lcd-m/romstage.c b/src/mainboard/kontron/986lcd-m/romstage.c index c356e5f..51a080a 100644 --- a/src/mainboard/kontron/986lcd-m/romstage.c +++ b/src/mainboard/kontron/986lcd-m/romstage.c @@ -183,8 +183,6 @@
static void rcba_config(void) { - u32 reg32; - /* Set up virtual channel 0 */
/* Device 1f interrupt pin register */ @@ -202,26 +200,6 @@ /* Enable IOAPIC */ RCBA8(OIC) = 0x03;
- /* Disable unused devices */ - reg32 = 0; - - if (read_option(ethernet1, 0) != 0) { - printk(BIOS_DEBUG, "Disabling ethernet adapter 1.\n"); - reg32 |= FD_PCIE1; - } - if (read_option(ethernet2, 0) != 0) { - printk(BIOS_DEBUG, "Disabling ethernet adapter 2.\n"); - reg32 |= FD_PCIE2; - } - if (read_option(ethernet3, 0) != 0) { - printk(BIOS_DEBUG, "Disabling ethernet adapter 3.\n"); - reg32 |= FD_PCIE3; - } - - reg32 |= 1; - - RCBA32(FD) = reg32; - /* Enable PCIe Root Port Clock Gate */
}