diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2012-12-20 18:42:00 +0100 |
---|---|---|
committer | Paul Menzel <paulepanter@users.sourceforge.net> | 2012-12-30 22:45:56 +0100 |
commit | 34746a9c48165f89f80fb664d46b646ca9e44779 (patch) | |
tree | 017f9e9e293e92419c1c213a3cfedea475a0ad06 /src/southbridge/amd/rs780 | |
parent | 9a0e3e2fc205381746875bee5296777b608bea54 (diff) | |
download | coreboot-34746a9c48165f89f80fb664d46b646ca9e44779.tar.xz |
rs780: Implement `rs780_internal_gfx_disable` and add .disable pcie_ops
That code will be used to disable the internal GFX card and enable the
external PCIe card.
The following lines from function `rs780_internal_gfx_enable()` are
taken and reversed.
/* 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);
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@no-log.org>
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/2065
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/amd/rs780')
-rw-r--r-- | src/southbridge/amd/rs780/gfx.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/southbridge/amd/rs780/gfx.c b/src/southbridge/amd/rs780/gfx.c index f70cd9bb79..da553529d0 100644 --- a/src/southbridge/amd/rs780/gfx.c +++ b/src/southbridge/amd/rs780/gfx.c @@ -760,6 +760,23 @@ static void internal_gfx_pci_dev_init(struct device *dev) clkind_write(dev, 0x5C, 0x0); } +/** + * Set registers in RS780 and CPU to disable the internal GFX. + * Please refer to `rs780_internal_gfx_enable()`. + */ +static void rs780_internal_gfx_disable(device_t dev) +{ + u32 l_dword; + device_t nb_dev = dev_find_slot(0, 0); + + /* Disable internal GFX and enable external 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 +1016,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, }; |