[coreboot] Patch set updated for coreboot: da1b9dd rs780: add .disable pcie_ops

Denis Carikli (GNUtoo@no-log.org) gerrit at coreboot.org
Sat Dec 29 20:31:45 CET 2012


Denis Carikli (GNUtoo at no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2065

-gerrit

commit da1b9ddec39b0dc1dfda76dabc0568d47e942183
Author: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
Date:   Thu Dec 20 18:42:00 2012 +0100

    rs780: add .disable pcie_ops
    
    That code will be used to disable the internal GFX card
      and enable the external PCIe CARD.
    
    It has been tested on the M4A785T-M with the following card
      inside the PCIe 16x slot:
      02:00.0 VGA compatible controller: nVidia Corporation GT218 [GeForce 210] (rev a2)
    
    Change-Id: I7bd412b987fde98c97464175e2c7a384a8f0fb84
    Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
 src/southbridge/amd/rs780/gfx.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/southbridge/amd/rs780/gfx.c b/src/southbridge/amd/rs780/gfx.c
index f70cd9b..eb85d01 100644
--- a/src/southbridge/amd/rs780/gfx.c
+++ b/src/southbridge/amd/rs780/gfx.c
@@ -760,6 +760,20 @@ static void internal_gfx_pci_dev_init(struct device *dev)
 	clkind_write(dev, 0x5C, 0x0);
 }
 
+/* Disable internal GFX and Enable external GFX. */
+static void rs780_internal_gfx_disable(device_t dev)
+{
+	u32 l_dword;
+	device_t nb_dev = dev_find_slot(0, 0);
+
+	/* Disable external GFX and enable internal GFX. */
+	l_dword = pci_read_config32(nb_dev, 0x8c);
+	l_dword |= 1<<0;
+	l_dword &= ~(1<<1);
+	pci_write_config32(nb_dev, 0x8c, l_dword);
+
+	dev->enabled = 0;
+}
 
 /*
 * Set registers in RS780 and CPU to enable the internal GFX.
@@ -999,6 +1013,7 @@ static struct device_operations pcie_ops = {
 	.init = internal_gfx_pci_dev_init,	/* The option ROM initializes the device. rs780_gfx_init, */
 	.scan_bus = 0,
 	.enable = rs780_internal_gfx_enable,
+	.disable = rs780_internal_gfx_disable,
 	.ops_pci = &lops_pci,
 };
 



More information about the coreboot mailing list