diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2015-05-29 16:18:01 +0200 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2015-06-09 19:52:27 +0200 |
commit | c16e9dfa18cb37b40ef7eef87f22385215b04ec2 (patch) | |
tree | 9d9445c8bf36bb359b6fdc6f84bb3e0095962b23 /src/northbridge/intel/sandybridge/northbridge.c | |
parent | 4fbac465246d3cdfc91d4331be5a567f8783cc6f (diff) | |
download | coreboot-c16e9dfa18cb37b40ef7eef87f22385215b04ec2.tar.xz |
Create i945-ivy smm tseg init based on ivy code.
CPU-side logic is unchanged for this range of CPUs as long as all of them
use TSEG (or ASEG, just needs to be consistent). So uplift 206ax code while
extracting southbridge and APIC code into separate functions.
Change-Id: Ib365681d1da8115922c557fddcc59afc156826da
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10465
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/northbridge/intel/sandybridge/northbridge.c')
-rw-r--r-- | src/northbridge/intel/sandybridge/northbridge.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c index 7d257f6fe3..0e0ba00cf1 100644 --- a/src/northbridge/intel/sandybridge/northbridge.c +++ b/src/northbridge/intel/sandybridge/northbridge.c @@ -36,6 +36,7 @@ #include <cbmem.h> #include "chip.h" #include "sandybridge.h" +#include <cpu/intel/smm/gen1/smi.h> static int bridge_revision_id = -1; @@ -432,6 +433,33 @@ static void northbridge_enable(device_t dev) #endif } +static u32 northbridge_get_base_reg(device_t dev, int reg) +{ + u32 value; + + value = pci_read_config32(dev, reg); + /* Base registers are at 1MiB granularity. */ + value &= ~((1 << 20) - 1); + return value; +} + +void +northbridge_get_tseg_base_and_size(u32 *tsegmb, u32 *tseg_size) +{ + device_t dev; + u32 bgsm; + dev = dev_find_slot(0, PCI_DEVFN(0, 0)); + + *tsegmb = northbridge_get_base_reg(dev, TSEG); + bgsm = northbridge_get_base_reg(dev, BGSM); + *tseg_size = bgsm - *tsegmb; +} + +void northbridge_write_smram(u8 smram) +{ + pci_write_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), SMRAM, smram); +} + static struct pci_operations intel_pci_ops = { .set_subsystem = intel_set_subsystem, }; |