summaryrefslogtreecommitdiff
path: root/src/northbridge/amd
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-04-09 14:46:51 +0000
committerStefan Reinauer <stepan@openbios.org>2010-04-09 14:46:51 +0000
commitd4f53738e678f99bd12068b2e2b2ecae9fc046b0 (patch)
tree0f15a41041822a88cef4fb74fa747b0021ac8960 /src/northbridge/amd
parentf358c0c55510e4272ace99e192b9494e64f89697 (diff)
zero warnings days.
The tyan s2895 is down to 3 warnings, 2 of which are caused by #warning. The 1000 ways of how the AMD code waits for the cores to be started up are a real pain for the brain. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5396 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r--src/northbridge/amd/amdk8/debug.c2
-rw-r--r--src/northbridge/amd/amdk8/incoherent_ht.c3
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c2
-rw-r--r--src/northbridge/amd/amdk8/raminit.c11
-rw-r--r--src/northbridge/amd/amdk8/raminit.h6
-rw-r--r--src/northbridge/amd/amdk8/setup_resource_map.c86
6 files changed, 37 insertions, 73 deletions
diff --git a/src/northbridge/amd/amdk8/debug.c b/src/northbridge/amd/amdk8/debug.c
index 97ca25577c..5cb996aa89 100644
--- a/src/northbridge/amd/amdk8/debug.c
+++ b/src/northbridge/amd/amdk8/debug.c
@@ -84,7 +84,7 @@ static inline void dump_pci_device_index_wait(unsigned dev, uint32_t index_reg)
}
#endif
-static void dump_pci_devices(void)
+static inline void dump_pci_devices(void)
{
device_t dev;
for(dev = PCI_DEV(0, 0, 0);
diff --git a/src/northbridge/amd/amdk8/incoherent_ht.c b/src/northbridge/amd/amdk8/incoherent_ht.c
index 4e295d3323..ddf613ea54 100644
--- a/src/northbridge/amd/amdk8/incoherent_ht.c
+++ b/src/northbridge/amd/amdk8/incoherent_ht.c
@@ -476,6 +476,7 @@ end_of_chain: ;
}
+#if 0
#if RAMINIT_SYSINFO == 1
static void ht_setup_chain(device_t udev, unsigned upos, struct sys_info *sysinfo)
#else
@@ -506,6 +507,8 @@ static int ht_setup_chain(device_t udev, unsigned upos)
return ht_setup_chainx(udev, upos, 0, offset_unitid);
#endif
}
+#endif
+
static int optimize_link_read_pointer(uint8_t node, uint8_t linkn, uint8_t linkt, uint8_t val)
{
uint32_t dword, dword_old;
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index 373501c9ad..b6cc32426a 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -925,7 +925,7 @@ static void amdk8_domain_set_resources(device_t dev)
#if 1
#warning "FIXME improve mtrr.c so we don't use up all of the mtrrs with a 64M MMIO hole"
- /* Round the mmio hold to 64M */
+ /* Round the mmio hole to 64M */
mmio_basek &= ~((64*1024) - 1);
#endif
diff --git a/src/northbridge/amd/amdk8/raminit.c b/src/northbridge/amd/amdk8/raminit.c
index 577e7fd4bb..ad257d0ed6 100644
--- a/src/northbridge/amd/amdk8/raminit.c
+++ b/src/northbridge/amd/amdk8/raminit.c
@@ -7,6 +7,7 @@
#include <cpu/x86/cache.h>
#include <cpu/x86/mtrr.h>
#include <stdlib.h>
+#include <reset.h>
#include "raminit.h"
#include "amdk8.h"
@@ -564,11 +565,13 @@ static int is_dual_channel(const struct mem_controller *ctrl)
static int is_opteron(const struct mem_controller *ctrl)
{
- /* Test to see if I am an Opteron.
- * FIXME Socket 939 based Athlon64 have dual channel capability,
- * too, so we need a better test for Opterons
+ /* Test to see if I am an Opteron. Socket 939 based Athlon64
+ * have dual channel capability, too, so we need a better test
+ * for Opterons.
+ * However, all code uses is_opteron() to find out whether to
+ * use dual channel, so if we really check for opteron here, we
+ * need to fix up all code using this function, too.
*/
-#warning "FIXME: Implement a better test for Opterons"
uint32_t nbcap;
nbcap = pci_read_config32(ctrl->f3, NORTHBRIDGE_CAP);
return !!(nbcap & NBCAP_128Bit);
diff --git a/src/northbridge/amd/amdk8/raminit.h b/src/northbridge/amd/amdk8/raminit.h
index f46e58defe..a5935612b8 100644
--- a/src/northbridge/amd/amdk8/raminit.h
+++ b/src/northbridge/amd/amdk8/raminit.h
@@ -11,4 +11,10 @@ struct mem_controller {
uint16_t channel1[DIMM_SOCKETS];
};
+#if defined(__PRE_RAM__) && defined(RAMINIT_SYSINFO) && RAMINIT_SYSINFO == 1
+void sdram_initialize(int controllers, const struct mem_controller *ctrl, void *sysinfo);
+#else
+void sdram_initialize(int controllers, const struct mem_controller *ctrl);
+#endif
+
#endif /* RAMINIT_H */
diff --git a/src/northbridge/amd/amdk8/setup_resource_map.c b/src/northbridge/amd/amdk8/setup_resource_map.c
index 96f1c5dca6..81beed2631 100644
--- a/src/northbridge/amd/amdk8/setup_resource_map.c
+++ b/src/northbridge/amd/amdk8/setup_resource_map.c
@@ -3,15 +3,14 @@
static void setup_resource_map_offset(const unsigned int *register_values, int max, unsigned offset_pci_dev, unsigned offset_io_base)
{
int i;
-// print_debug("setting up resource map offset....");
-#if 0
- print_debug("\n");
+#if RES_DEBUG
+ printk(BIOS_DEBUG, "setting up resource map offset....\n");
#endif
for(i = 0; i < max; i += 3) {
device_t dev;
unsigned where;
unsigned long reg;
-#if 0
+#if RES_DEBUG
prink_debug("%08x <- %08x\n", register_values[i] + offset_pci_dev, register_values[i+2]);
#endif
dev = (register_values[i] & ~0xfff) + offset_pci_dev;
@@ -27,7 +26,9 @@ static void setup_resource_map_offset(const unsigned int *register_values, int m
pci_write_config32(register_values[i], reg);
#endif
}
-// print_debug("done.\n");
+#if RES_DEBUG
+ printk(BIOS_DEBUG, "done.\n");
+#endif
}
#define RES_PCI_IO 0x10
@@ -40,12 +41,7 @@ static void setup_resource_map_x_offset(const unsigned int *register_values, int
int i;
#if RES_DEBUG
- print_debug("setting up resource map ex offset....");
-
-#endif
-
-#if RES_DEBUG
- print_debug("\n");
+ printk(BIOS_DEBUG, "setting up resource map ex offset....\n");
#endif
for(i = 0; i < max; i += 4) {
#if RES_DEBUG
@@ -112,21 +108,19 @@ static void setup_resource_map_x_offset(const unsigned int *register_values, int
}
#if RES_DEBUG
- print_debug("done.\n");
+ printk(BIOS_DEBUG, "done.\n");
#endif
}
+
+#if defined(SOUTHBRIDGE_NVIDIA_MCP55) || defined(SOUTHBRIDGE_NVIDIA_CK804)
static void setup_resource_map_x(const unsigned int *register_values, int max)
{
int i;
#if RES_DEBUG
- print_debug("setting up resource map ex offset....");
-
+ printk(BIOS_DEBUG, "setting up resource map ex....\n");
#endif
-#if RES_DEBUG
- print_debug("\n");
-#endif
for(i = 0; i < max; i += 4) {
#if RES_DEBUG
printk(BIOS_DEBUG, "%04x: %02x %08x <- & %08x | %08x\n",
@@ -188,47 +182,12 @@ static void setup_resource_map_x(const unsigned int *register_values, int max)
}
#if RES_DEBUG
- print_debug("done.\n");
+ printk(BIOS_DEBUG, "done.\n");
#endif
}
-
-#if 0
-static void setup_iob_resource_map(const unsigned int *register_values, int max)
-{
- int i;
-
- for(i = 0; i < max; i += 3) {
- unsigned where;
- unsigned reg;
-
- where = register_values[i];
-#if 0
- udelay(2000);
- print_debug_hex16(where);
-#endif
- reg = inb(where);
-#if 0
- print_debug("=");
- print_debug_hex8(reg);
#endif
- reg &= register_values[i+1];
- reg |= register_values[i+2];
#if 0
- print_debug(" <- ");
- print_debug_hex8(reg);
-#endif
- outb(reg, where);
-#if 0
-
- print_debug(" -> ");
- reg = inb(where);
- print_debug_hex8(reg);
- print_debug("\n");
-#endif
- }
-}
-
static void setup_io_resource_map(const unsigned int *register_values, int max)
{
int i;
@@ -240,30 +199,26 @@ static void setup_io_resource_map(const unsigned int *register_values, int max)
where = register_values[i];
#if 0
udelay(2000);
- print_debug_hex16(where);
+ printk(BIOS_DEBUG, "%04x", where);
#endif
reg = inl(where);
#if 0
udelay(2000);
- print_debug("=");
- print_debug_hex32(reg);
+ printk(BIOS_DEBUG, "=%08x", reg);
#endif
reg &= register_values[i+1];
reg |= register_values[i+2];
#if 0
udelay(2000);
- print_debug(" <- ");
- print_debug_hex32(reg);
+ printk(BIOS_DEBUG, " <- %08x", reg);
#endif
outl(reg, where);
#if 0
udelay(2000);
- print_debug(" -> ");
reg = inl(where);
- print_debug_hex32(reg);
- print_debug("\n");
+ printk(BIOS_DEBUG, " -> %08x\n", reg);
#endif
}
}
@@ -276,9 +231,8 @@ static void setup_mem_resource_map(const unsigned int *register_values, int max)
unsigned where;
unsigned long reg;
#if 0
- print_debug_hex32(register_values[i]);
- print_debug(" <-");
- print_debug_hex32(register_values[i+2]);
+ prink(BIOS_DEBUG, "%08x <- %08x\n",
+ register_values[i], register_values[i+2]);
#endif
where = register_values[i];
reg = read32(where);
@@ -286,10 +240,8 @@ static void setup_mem_resource_map(const unsigned int *register_values, int max)
reg |= register_values[i+2];
write32( where, reg);
#if 0
- print_debug(" RB ");
reg = read32(where);
- print_debug_hex32(reg);
- print_debug("\n");
+ prink(BIOS_DEBUG, " RB %08x\n", reg);
#endif
}
}