From 8376831eafc1be1175529fd21e0d2fe40339d4eb Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Tue, 6 Jul 2010 20:36:36 +0000 Subject: A bug fix: Fix the ctrl_devport_conf_clear to clear the enable bit. A simplification: Dynamically enable ck804s that are found instead of relying on #defines. Removing an Opteron changes the number of ck804s that are present. Simple changes to make it easier to compare the factory BIOS with Coreboot when using SerialICE for boards with the Nvidia ck804 chipset: If the mask is zero, don't read the value, just write the new value over it. Signed-off-by: Myles Watson Acked-by: Myles Watson git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5652 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdk8/setup_resource_map.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdk8/setup_resource_map.c b/src/northbridge/amd/amdk8/setup_resource_map.c index 82622cdc4c..e5fda596e7 100644 --- a/src/northbridge/amd/amdk8/setup_resource_map.c +++ b/src/northbridge/amd/amdk8/setup_resource_map.c @@ -15,7 +15,8 @@ static void setup_resource_map_offset(const unsigned int *register_values, int m #endif dev = (register_values[i] & ~0xfff) + offset_pci_dev; where = register_values[i] & 0xfff; - reg = pci_read_config32(dev, where); + if (register_values[i+1]) + reg = pci_read_config32(dev, where); reg &= register_values[i+1]; reg |= register_values[i+2] + offset_io_base; pci_write_config32(dev, where, reg); @@ -60,7 +61,8 @@ static void setup_resource_map_x_offset(const unsigned int *register_values, int unsigned long reg; dev = (register_values[i+1] & ~0xfff) + offset_pci_dev; where = register_values[i+1] & 0xfff; - reg = pci_read_config32(dev, where); + if (register_values[i+2]) + reg = pci_read_config32(dev, where); reg &= register_values[i+2]; reg |= register_values[i+3]; pci_write_config32(dev, where, reg); @@ -71,7 +73,8 @@ static void setup_resource_map_x_offset(const unsigned int *register_values, int unsigned where; unsigned reg; where = register_values[i+1] + offset_io_base; - reg = inb(where); + if (register_values[i+2]) + reg = inb(where); reg &= register_values[i+2]; reg |= register_values[i+3]; outb(reg, where); @@ -82,7 +85,8 @@ static void setup_resource_map_x_offset(const unsigned int *register_values, int unsigned where; unsigned long reg; where = register_values[i+1] + offset_io_base; - reg = inl(where); + if (register_values[i+2]) + reg = inl(where); reg &= register_values[i+2]; reg |= register_values[i+3]; outl(reg, where); -- cgit v1.2.3