diff options
author | Scott Duplichan <scott@notabs.org> | 2010-11-24 00:39:44 +0000 |
---|---|---|
committer | Scott Duplichan <scott@notabs.org> | 2010-11-24 00:39:44 +0000 |
commit | 88dc53178177c3cfc28bfebab2422dc4133bd7dc (patch) | |
tree | 9043197ae117f504212f0377ef17cce5da771115 /src/southbridge/amd/rs780/rs780_cmn.c | |
parent | 0cda9597109f2e4cd922ee4ec66367b6513360db (diff) |
This patch solves crashes and BSODs that occur when booting Win7 with
AMD RS780 uma graphics. Tested with frame buffer sizes 64m through 1GB
by running dxdiag and Windows media player at 1600x1200 true color.
Additional changes needed to boot Win7 on Mahogany_fam10 will follow.
-- Enable and program the debug bar as required by the ATI graphics driver.
First, make the debug bar writable and allow resource allocation code
to program it. Once programmed, enable its operation.
-- Disable the family 10h processor mmconf while the RS780 mmconf is in use.
-- Make strap programming more closely follow the reference BIOS.
-- Disable PCIe bar 3 after using it.
-- UMA size is no longer hardcoded.
-- Disable write combining for all steppings to eliminate stability problem.
-- Correct task file data.
-- Improve the accuracy of the Atom table that passes information to the driver.
Signed-off-by: Scott Duplichan <scott@notabs.org>
Acked-by: Rudolf Marek <r.marek@assembler.cz>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6120 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/amd/rs780/rs780_cmn.c')
-rw-r--r-- | src/southbridge/amd/rs780/rs780_cmn.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/southbridge/amd/rs780/rs780_cmn.c b/src/southbridge/amd/rs780/rs780_cmn.c index 8d80a06118..4bd870bbf2 100644 --- a/src/southbridge/amd/rs780/rs780_cmn.c +++ b/src/southbridge/amd/rs780/rs780_cmn.c @@ -29,6 +29,7 @@ #include <cpu/amd/mtrr.h> #include <boot/coreboot_tables.h> #include <delay.h> +#include <cpu/cpu.h> #include "rs780.h" static u32 nb_read_index(device_t dev, u32 index_reg, u32 index) @@ -361,3 +362,42 @@ void rs780_set_tom(device_t nb_dev) pci_write_config32(nb_dev, 0x90, uma_memory_base); //nbmc_write_index(nb_dev, 0x1e, uma_memory_base); } + +// extract single bit +u32 extractbit(u32 data, int bit_number) +{ + return (data >> bit_number) & 1; +} + +// extract bit field +u32 extractbits(u32 source, int lsb, int msb) +{ + int field_width = msb - lsb + 1; + u32 mask = 0xFFFFFFFF >> (32 - field_width); + return (source >> lsb) & mask; +} + +// return AMD cpuid family +int cpuidFamily(void) +{ + u32 baseFamily, extendedFamily, fms; + + fms = cpuid_eax (1); + baseFamily = extractbits (fms, 8, 11); + extendedFamily = extractbits (fms, 20, 27); + return baseFamily + extendedFamily; +} + + +// return non-zero for AMD family 0Fh processor found +int is_family0Fh(void) +{ + return cpuidFamily() == 0x0F; +} + + +// return non-zero for AMD family 10h processor found +int is_family10h(void) +{ + return cpuidFamily() == 0x10; +} |